I have a number of content items titled in the format of "{Month} What's On". When I search for this it returns a matching result, however, when I search for "What's On {Month}" it finds 0 results.
var criteria = ExamineManager.Instance.SearchProviderCollection["WebsiteSearcher"].CreateSearchCriteria(); Examine.SearchCriteria.IBooleanOperation filter = null;
var fields = new string[] { "nodeName", "pageTitle", "pageShort", "pageContent", "uBlogsyContentTitle", "uBlogsyContentSummary", "uBlogsyContentBody" };
filter = criteria.GroupedOr(fields, term);
var searchResults = Examine.ExamineManager.Instance
Search not working as expected
I have a number of content items titled in the format of "{Month} What's On". When I search for this it returns a matching result, however, when I search for "What's On {Month}" it finds 0 results.
var criteria = ExamineManager.Instance.SearchProviderCollection["WebsiteSearcher"].CreateSearchCriteria();
Examine.SearchCriteria.IBooleanOperation filter = null;
var fields = new string[] { "nodeName", "pageTitle", "pageShort", "pageContent", "uBlogsyContentTitle", "uBlogsyContentSummary", "uBlogsyContentBody" };
filter = criteria.GroupedOr(fields, term);
var searchResults = Examine.ExamineManager.Instance
.SearchProviderCollection["WebsiteSearcher"]
.Search(filter.Compile())
.OrderByDescending(x => x.Score);
Anyone got an idea of how I can get it to return the results irrelevant of the order of the words?
Hi Michael,
I think what your after is described in the excellent blog post http://smdool.co.uk/umbraco-examine-multiple-word-search as it splits the words up
Hope that's helpful,
Jeavon
is working on a reply...