8

I've had a serious problem with several clients while utilising a Lucene search index where anomalies like content missing that should be there or duplicate content (more than one document of the same content item that both have the islatest flag). In many cases an index rebuild will fix it, but more often than not a rebuild will simply shuffle around the anomalies.

Ultimately I'm asking is there a way to configure the search index to be more consistent and reliable?

Note that I'm specifically talking about the sitecore_master_index and sitecore_web_index.

  • Have you checked into the tables for publishing and events? Sometimes these tables become very large. Perhaps you can perform a cleanup on the tables and then ensure the agents run more frequently. More details can be found here: stackoverflow.com/questions/24192678/… – Michael West Oct 3 '16 at 22:14
  • The details you have provided in your question are not enough to understand your issue. Please edit your question and include additional information, such as: Is the index a standard one or a custom one? If it's custom, include its configuration and custom code. Specify which fields have missing/duplicate values. Is your site multi-language? Does your index use all item languages? Etc. – Dmytro Shevchenko Oct 5 '16 at 10:39
5

I have implemented several search based sites on top of the Lucene provider, and for me the system is consistent and reliable. When I have had that sort of problems with the index in the past it was due to two reasons:

  • The scope of my SearchContent: I was reusing it too much, meaning my results were not updated, even when the actual index was. As the index was constantly updated, I had to call Index.CreateSearchContent each time I had to search.
  • Obsolete items in the index: I managed to fix it following this KB
  • KB 992608 fixed my issue. – Ged Oct 12 '16 at 13:40
  • Great to see that you fixed your problem. Could you please mark the answer as solution? – Vicent Galiana Oct 13 '16 at 6:29
6

If it is a custom config then it should also contain the _uniqueid field.

<field fieldName="_uniqueid" storageType="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>

It looks like that it is problem. Because when you rebuild the index then it doesn't care about existing entries in the index, it just rebuild it. In the other cases it needs the _uniqueid to find in the index.

Here you can find a detailed blog post about it: https://trnktms.wordpress.com/2016/09/29/duplicate-entries-in-lucene-index-after-item-publishsave

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.