0
votes

I've created an indexer inside the examine manager from Umbraco 7.6 and would search for some items. I see that this is case sensitive, how could I disable this?

This is what I've made:

ExamineSettings.config inside the ExamineIndexProviders\provders tag:

<add name="ArtsenIndexer" 
     type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine" 
     supportUnpublished="false"
     supportProtected="true" 
     indexSet="Artsen"
     analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>

ExamineSettings.config inside the ExamineSearchProviders\provders tag:

<add name="ArtsenSearcher" 
     type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" 
     supportUnpublished="false"
     supportProtected="false" 
     indexSet="Artsen" 
     enableLeadingWildcard="true"
     analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>

ExamineIndex.config:

<IndexSet SetName="Artsen" IndexPath="~/App_Data/TEMP/ExamineIndexes/Artsen/" >
    <IndexAttributeFields>
        <add Name="id" />
        <add Name="nodeName" />
        <add Name="nodeTypeAlias"/>
        <add Name="updateDate"/>
    </IndexAttributeFields>
    <IndexUserFields>
        <add Name="email" />
        <add Name="fax" />
        <add Name="naam"/>
        <add Name="onderzoeken"/>
        <add Name="specialismen"/>
        <add Name="subspecialismen"/>
        <add Name="telefoon"/>
        <add Name="titel"/>
        <add Name="voornaam"/>
        <add Name="website"/>
    </IndexUserFields>
    <IncludeNodeTypes>
        <add Name="arts" />
    </IncludeNodeTypes>
</IndexSet>

I've searched on the internet and a lot of variaties but found no results to ignore the casing.

Update:

On this post I've read this:

The WhitespaceAnalyzer is a case-sensitive searcher,

So I must use this: StandardAnalyzer but didn't help me. The link in the post is broken...

1

1 Answers

2
votes

That's correct. WhitespaceAnalyzer is not changing casing for data when indexing, so it will do it's job when looking for specific case sensitive values is required.

StandardAnalyzer is lowercasing the queries and data while performing indexing and searching so no matter what type of cases will be present in the query it will always look for the same lowercased version of the term.

If you want to apply this change and it will fit your expectations and requirements, you need to change the analyzer value to become "Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" in both: indexer and searcher.

Remember to rebuild indexes to preview the result.