3

I have a Lucene index for the Master db. It seems like every save creates a new entry in the Lucene index. At first I thought it was versioning but as you can see in the screen shot, it's the same version (varsion is "1" for all entries). The only columns that are different are "Doc. Id","_updated" and any content fields have have changed between saves. If i do a rebuild of the index, everything looks correct.

Luke Results

We are running 8.2. I saw this behavior in 8.1 as well. Is there a configuration or column that I am missing to ensure there's only 1 entry per item?

here is my configuration

<indexes hint="list:AddIndex">
      <index id="foo_bar_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
        <param desc="name">$(id)</param>
        <param desc="folder">$(id)</param>
        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/masterProductConfiguration" />
        <strategies hint="list:AddStrategy">
          <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/syncMaster" />
        </strategies>
        <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
          <policies hint="list:AddCommitPolicy">
            <policy type="Sitecore.ContentSearch.ModificationCountCommitPolicy, Sitecore.ContentSearch">
              <Limit>300</Limit>
            </policy>
          </policies>
        </commitPolicyExecutor>
        <locations hint="list:AddCrawler">
          <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
            <Database>master</Database>
            <Root>/sitecore/content/FooBar/Home</Root>
          </crawler>
        </locations>
        <enableItemLanguageFallback>false</enableItemLanguageFallback>
        <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
      </index>
    </indexes>

I saw this thread, which looks similar to my issue but my issue does not have to do with media files or publishing.

Sitecore 8: Items Duplicated in Web Index After Publish

  • Are you sure that you put the correct configuration here? It is configured to use the web database, but at the screenshot I see paths for master database. Does it correct? – Artsem Prashkovich May 5 '17 at 20:59
  • And the statement "Every save". The item wont make it to web on save. Only publish. – Chris Auer May 6 '17 at 3:12
  • Do you have the "_uniqueId" in your productSearchConfuguration? Usually this the problem, it is needed for Lucene. – Tamás Tárnok May 6 '17 at 7:05
  • @ArtsemPrashkovich I copied the wrong config. That is one in our web db. The config is identical except the db being indexed. I updated the question – BFK May 6 '17 at 14:35
  • 1
    @TamásTárnok i do not have the "_uniqueid" explicitly defined in the configuration but as you can see from the screen shot, it is being added automatically. i will explicitly add it and see if that fixes it – BFK May 6 '17 at 14:38
2

Even though Sitecore automaticallly adds the "_uniqueid" column, it seems that explicitly adding the column to the configuration fixes this issue.

<productSearchConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider">
 <fieldMap>
  <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>
 </fieldMap>
 <include hint="list:AddIncludedField">
  <fieldId>_uniqueid</fieldId>
 </include>
</productSearchConfiguration>
  • Thanks for sharing. Please feel free to tick "answered", for the records :-) – Mark Cassidy May 8 '17 at 11:58
  • This is the same solution I came up with for my similar question. Duplicate? – jrap May 8 '17 at 22:15
  • @jrap i think you are right. I had slightly different circumstances but basically a duplicate. I didn't think your answer applied to me b/c the "_uniqueid" column was appearing in my index, even tho it wasn't explicitly defined in my configuration. Sitecore must look directly at the config to determine if there is a unique id even tho they add it anyway. I'll mark it as duplicate. do you mind adding to your answer that the conifg needs it defined even if it's already automatically being added to the index by sitecore? Thanks! – BFK May 9 '17 at 11:04
  • Will do @BFK. Coming shortly. – jrap May 9 '17 at 17:06

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