Wednesday, April 27, 2016

Sitecore Lucene ensure there are no duplicate search results

If a Sitecore Lucene search index is set to update incrementally, when a document is updated it is simply added to the index (ignoring if it was already there). By adding the unique ID field (aka item GUID) to your search index using the lower case keyword analyser you can stop the duplicates.

<field fieldName="_uniqueid" torageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
  <analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />
</field>

This should be in every custom Lucene index in which you create.

No comments:

Post a Comment