I need to limit my Lucene/Examine search to two searchPaths (rootNodes from multi site solution). So i need to search two sites out of 10 for instance.
But how do i config my query to accomplish this? I tried a variaty of things, but none have worked.
Wow, a question from 2014 the topic of which troubled me in 2020! I'm facing the same problem - I want to either include multiple searchPaths or exclude multiple searchPaths, but it doesn't seem to be working at all. I'm constructing a raw query and done all the OP has done. Any hints?
More necro posting, but FWIW - just had to solve this myself on a v7 site.
In this 'works for me' solution, the trick seems to be that it needs to be a groupedOr so that the Examine will search for multiple values on the same key.
The raw syntax for the multiple paths looks something like (assuming you save the fields with commas replaced by spaces):
+(searchPath:"1 1056" searchPath:"1 1441")
The v7 API to add this is something like: (assuming these are both root child nodes)
var criteria = baseSearchProvider.CreateSearchCriteria(BooleanOperation.And);
var searchPaths = new List<string>();
searchPaths.Add(node1.Path.Replace(",", " "));
searchPaths.Add(node2.Path.Replace(",", " "));
var examineQuery = criteria.GroupedOr(new string[] { "searchPath" }, searchPaths.ToArray());
examineQuery = examineQuery.And().whatever-other-filters...
Examine: Multiple searchPath's?
I need to limit my Lucene/Examine search to two searchPaths (rootNodes from multi site solution). So i need to search two sites out of 10 for instance.
But how do i config my query to accomplish this? I tried a variaty of things, but none have worked.
This is what i have now;
This works fine, but only searches from one root node.
I tried the following, with no success;
Any ideas?
Wow, a question from 2014 the topic of which troubled me in 2020! I'm facing the same problem - I want to either include multiple searchPaths or exclude multiple searchPaths, but it doesn't seem to be working at all. I'm constructing a raw query and done all the OP has done. Any hints?
More necro posting, but FWIW - just had to solve this myself on a v7 site.
In this 'works for me' solution, the trick seems to be that it needs to be a groupedOr so that the Examine will search for multiple values on the same key.
The raw syntax for the multiple paths looks something like (assuming you save the fields with commas replaced by spaces):
The v7 API to add this is something like: (assuming these are both root child nodes)
is working on a reply...