Hey I'm trying to make a raw query string for my search.
I would like to only allow nodes with specific alias
I have tried with this.
var nodeAlias = new List<string>() { "articlePage", "sectionPage" };
var allowedContentTypes = string.Join(" ", nodeAlias.Select(x => $"{x}"));
if (allowedContentTypes.Any()) query.Append($" AND +(__NodeTypeAlias:{string.Join(" ", allowedContentTypes)})");
That gives me this AND +(__NodeTypeAlias:articlePage sectionPage File)
var nodeAlias = new List<string>() { "articlePage", "sectionPage", "File" };
var allowedContentTypes = string.Join(" OR ", nodeAlias.Select(x => $"__NodeTypeAlias:{x}"));
if (allowedContentTypes.Any()) query.Append($" AND (+({allowedContentTypes}))");
Examine Lucene
Hey I'm trying to make a raw query string for my search.
I would like to only allow nodes with specific alias
I have tried with this.
That gives me this
AND +(__NodeTypeAlias:articlePage sectionPage File)
It only looks at the first alias..
How do I add more then one alias?
Thanks :)
Got it to work :)
is working on a reply...