examine search does not work for some search terms
I am doing site search using examine. I followed umbraco tv to configure my two files and copy the code to my page_load event handler in my user control used to list search results.
var a = ExamineManager.Instance.SearchProviderCollection["someSearcher"];
SearchResults = a.Search(filter);
I does not work for some search terms and i will get a null reference exception when executing SearchResults = a.Search(filter);
When I comment out .search statement and print out the filter on the screen using response.write instead, i will see { SearchIndexType: , LuceneQuery: +(nodeName:My Search Term textBody:My Search Term) -umbracoNaviHide:1 } when working properly.
but in the cases where exceptions are thrown, response.write(filter) shows:
examine search does not work for some search terms
I am doing site search using examine. I followed umbraco tv to configure my two files and copy the code to my page_load event handler in my user control used to list search results.
SearchTerm = Request.QueryString["search"];
if (string.IsNullOrEmpty(SearchTerm)) return;
var criteria = ExamineManager.Instance
.SearchProviderCollection["someSearcher"]
.CreateSearchCriteria();
var filter = criteria
.GroupedOr(new string[] { "nodeName", "textBody" }, SearchTerm)
.Not().Field("umbracoNaviHide", "1")
.Compile();
var a = ExamineManager.Instance.SearchProviderCollection["someSearcher"];
SearchResults = a.Search(filter);
I does not work for some search terms and i will get a null reference exception when executing SearchResults = a.Search(filter);
When I comment out .search statement and print out the filter on the screen using response.write instead, i will see { SearchIndexType: , LuceneQuery: +(nodeName:My Search Term textBody:My Search Term) -umbracoNaviHide:1 } when working properly.
but in the cases where exceptions are thrown, response.write(filter) shows:
{ SearchIndexType: , LuceneQuery: +(null null) -umbracoNaviHide:1 }
Does anybody know why?
what are the search terms that are causing the error? Also take a look at your index with luke and try some searches http://www.getopt.org/luke/
Search terms like "a" causes the error, but if I try "b", "libero" that will work even if there are no matching results returned.
Thanks for that.
I changed the analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer,
to analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net" in my .config file, and it works.
I do not know what analyser means though.
is working on a reply...