On this blogpost by Aaron Powell on case-insensitive search with Examine, I read that I should use the StandardAnalyzer instead of the WhitespaceAnalyser. I tried to replace the WhiteSpaceAnalyzer with the StandardAnalyzer, but then my search page throws a null reference exception on this line:
var searcher = ExamineManager.Instance.SearchProviderCollection["CepecSearcher"];
How can I implement case-insensitive search with Examine for Umbraco?
how to enable case-insensitive search
Hi,
I implemented search with Examine for Umbraco on my website. My configuration looks like this:
ExamineIndex.config:
<!-- The index set for searching the cepec website -->
<IndexSet SetName="CepecIndexSet" IndexPath="~/App_Data/ExamineIndexes/Cepec/">
<IndexAttributeFields>
<add Name="id" />
<add Name="nodeName" />
<add Name="updateDate" />
<add Name="writerName" />
<add Name="path" />
<add Name="nodeTypeAlias" />
</IndexAttributeFields>
<IndexUserFields>
<add Name="bodyText" />
<add Name="pageDescription" />
<add Name="publicationTitle" />
<add Name="publicationAuthors" />
<add Name="publicationAbstract" />
</IndexUserFields>
<IncludeNodeTypes/>
<ExcludeNodeTypes />
</IndexSet>
ExamineSettings.config:
//IndexProvider
<add name="CepecIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="true"
supportProtected="true"
interval="10"
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
//SearchProvider
<add name="CepecSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"
indexSet="CepecIndexSet"/>
The search works, but it is not case-insensitive.
On this blogpost by Aaron Powell on case-insensitive search with Examine, I read that I should use the StandardAnalyzer instead of the WhitespaceAnalyser. I tried to replace the WhiteSpaceAnalyzer with the StandardAnalyzer, but then my search page throws a null reference exception on this line:
var searcher = ExamineManager.Instance.SearchProviderCollection["CepecSearcher"];
How can I implement case-insensitive search with Examine for Umbraco?
Thanks a lot for your help,
Anthony
I find the issue, it was a syntax case, instead of using
<add name="CepecSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.StandardAnalyzer, Lucene.Net"
indexSet="CepecIndexSet"/>
I should have used:
<add name="CepecSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"
indexSet="CepecIndexSet"/>
My case-insensitive search is working now!
Anthony
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.