Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I'm trying to exclude node Ids from an Examine search using the following code:
if (!ExamineManager.Instance.TryGetIndex(indexName, out IIndex index)) throw new Exception("Error"); ISearcher searcher = index.GetSearcher(); LuceneSearchQuery criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", field); criteria.Field("articleTags", fieldValue); criteria.GroupedNot(new List<string> {"nodeId", "id", "__NodeId"}, excludedNodeIds.ToArray());
My query looks like this before executing:
{+__NodeTypeAlias:newsarticle +articleTags:"athlete rights" (-id:1203 -__NodeId:1203)}
Which looks ok to me, but the document with that nodeId is still being returned in the query results.
I've tried adding the Node Id as a custom field "nodeId" to the Examine index, transforming the node Id to a string and an integer, but still nothing.
Has anyone been able to do this, or is there an easier way of excluding node Ids from the query?
Thanks
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Problem using GroupedNot to exclude fields in Examine
Hi,
I'm trying to exclude node Ids from an Examine search using the following code:
My query looks like this before executing:
Which looks ok to me, but the document with that nodeId is still being returned in the query results.
I've tried adding the Node Id as a custom field "nodeId" to the Examine index, transforming the node Id to a string and an integer, but still nothing.
Has anyone been able to do this, or is there an easier way of excluding node Ids from the query?
Thanks
is working on a reply...