if (ExamineManager.Instance.TryGetIndex("ExternalIndex", out var index))
{
var searcher = index.GetSearcher();
var results = searcher.CreateQuery("content").ManagedQuery(q).And().GroupedOr(new[] { "__NodeTypeAlias" }, "home", "parentContentPage", "childContentPage").Execute().ToList();
// not relevant
}
But it only returns exact matches, if I have a query 'technology assets' I would like to try and search for 'technology' and 'assets' then order by score.
I have seen loads of examples, but none for V8 as:
var Searcher = ExamineManager.Instance.SearchProviderCollection[examineSearcherName];
now returns IExamineManager does not contain a definition....
Worked it out, below is how I did it in case anyone ever needs this
string[] words = q.Split(' ');
List<string> newQuery = new List<string>();
foreach (var word in words)
{
newQuery.Add(word);
}
var searcher = index.GetSearcher();
var results = searcher.CreateQuery("content").GroupedOr(new[] { "nodeName","pageTitle","pageDescription"}, newQuery.ToArray()).Execute().ToList();
Examine not exact match search
Hi
How do you do a non-exact search using Examine?
I currently have:
But it only returns exact matches, if I have a query 'technology assets' I would like to try and search for 'technology' and 'assets' then order by score.
I have seen loads of examples, but none for V8 as:
now returns IExamineManager does not contain a definition....
Any help would be appreciated
George
Worked it out, below is how I did it in case anyone ever needs this
is working on a reply...