Alaa Shehebar
Alaa Shehebar

Reputation: 81

Examine Indexer

I'm working on an asp.net project and I'm having some issues with changing the Examine Indexer.

I used to have a StandardAnalyzer as an indexer but now I need to use an ArabicAnalyzer as an indexer. When testing it separately all I done was changing:

<add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="false"
interval="10"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>

With:

<add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="false"
interval="10"
analyzer="Lucene.Net.Analysis.AR, Lucene.Net"/>

And it worked properly. When tried to do the same on my existing project I got the following exception in an YSOD page.

Line 31:

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Value cannot be null.

I didn't find a solution for this. Do you have any ideas how to solve this?

Update:

<Examine>
  <ExamineIndexProviders>
    <providers>
      <add name="InternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
           supportUnpublished="false"
           supportProtected="true"
           analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>

      <add name="InternalMemberIndexer" type="UmbracoExamine.UmbracoMemberIndexer, UmbracoExamine"
           supportUnpublished="true"
           supportProtected="true"
           analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>

      <add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
             supportUnpublished="false"
             supportProtected="false"
             interval="10"
             analyzer="Lucene.Net.Analysis.AR, Lucene.Net"/>

    </providers>
  </ExamineIndexProviders>

  <ExamineSearchProviders defaultProvider="ExternalSearcher">
    <providers>
      <add name="InternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
           analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>

      <add name="ExternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" />

      <add name="InternalMemberSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
           analyzer="Lucene.Net.Analysis.AR, Lucene.Net" enableLeadingWildcards="true"/>

    <add name="EntitySearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
     analyzer="Lucene.Net.Analysis.AR, Lucene.Net" enableLeadingWildcards="true"/>
    </providers>
  </ExamineSearchProviders>

</Examine>

Upvotes: 0

Views: 2230

Answers (2)

Digbyswift
Digbyswift

Reputation: 10400

If it fails on an existing project, you may need to delete the existing index and then restart the application.

The indexes are all stored at ~/app_data/Temp/ExamineIndexes/, so you could just delete the specific index folder from within this folder and restart the application. This should prompt Umbraco to start re-indexing the content.

Also, you should also set the ExamineSearchProvider too, not just the ExamineIndexProvider. This is in the same config file. This ensures that the same Analyzer type is used to search the results as is to index them.

Edit

Looking at the configuration, you are missing an Analyzer="" on the ExternalSearcher

Further edit

The value Lucene.Net.Analysis.AR isn't a valid analyzer value it is just the namespace of an analyzer. I didn't check as I assumed you had, but the value should, in both instances be:

analyzer="Lucene.Net.Analysis.AR.ArabicAnalyzer, Lucene.Net"

See here: http://lucenenet.apache.org/docs/3.0.3/d2/d94/class_lucene_1_1_net_1_1_analysis_1_1_a_r_1_1_arabic_analyzer.html

Upvotes: 1

Alaa Shehebar
Alaa Shehebar

Reputation: 81

I figured it out, What I should've done is changing:

<add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="false"
interval="10"
analyzer="Lucene.Net.Analysis.AR, Lucene.Net"/>

with:

<add name="EntityIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="false"
supportProtected="false"
interval="10"
analyzer="Lucene.Net.Analysis.AR.ArabicAnalyzer, Lucene.Net.Contrib.Analyzers"/>

And changing the SearchProvider as well.

Upvotes: 0

Related Questions