Sitecore syncMaster index strategy not working
Asked Answered
A

1

7

I have a rendering component that runs a search using the Lucene index to populate itself.

We have two indexes defined; Master & Web. When in the experience editor it uses the Master index, and the Web index for the actual site.

We've configured the Web index strategy as onPublishEndAsync, and we've configured the Master index strategy as syncMaster, the idea being that CMS users can add/edit Sitecore items that power this component, and see them straight away in the experience editor.

However, it seems that the master index is not being updated as we change data in Sitecore. The experience editor only shows the data once I've manually run an index rebuild.

        <strategies hint="list:AddStrategy">
          <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/syncMaster" />
        </strategies>

Why doesn't the index update itself upon data changes?

UPDATE

So I've compared the files suggested to a clean install and they are the same.

I should add, I'm not using the standard sitecore_master_index. We have multiple sites running off the same instance of sitecore, so we have added a config include for websitename_master_index. I have compared the config for this within the <index> node against sitecore_master_index in Sitecore.ContentSearch.Lucene.Index.Master.config and the only differences are the crawler's <root> element which points to the particular sites content node, plus we've added some custom fields, but I assume that these fields wouldn't be causing a problem we can manually rebuild the index fine?

One other interesting thing I found when looking at the showconfig.aspx was this:

<agent type="Sitecore.ContentSearch.Tasks.Optimize" method="Run" interval="12:00:00" patch:source="Sitecore.ContentSearch.config">
    <indexes hint="list">
        <index>sitecore_master_index</index>
    </indexes>
</agent>

I'm not sure if this has any significance, but there was not a matching entry for our custom websitename_master_index?

UPDATE

I've also added debug level logging to the crawler

In the crawling.log I only see the following:

14416 08:55:10 INFO  [Index=website_master_index] Initializing SitecoreItemCrawler. DB:master / Root:/sitecore/Content/Website/Home    
14416 08:55:10 INFO  [Index=website_master_index] Initializing SynchronousStrategy.

Upon editing and saving items, there is no further mention of the index in the log, and this is actually true of the standard sitecore_master_index which we haven't altered the config for?

Asmara answered 3/3, 2016 at 14:3 Comment(5)
Can you compare Sitecore.ContentSearch.Lucene.Index.Master.config from your solution with same file from a clean solution?Syncopation
The out of the box index configuration is set this way. Have you made any modifications to Sitecore.ContentSearch.DefaultConfigurations.config, Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config or Sitecore.ContentSearch.Lucene.Index.Master.config. Any errors in the logs to help?Liebknecht
doc.sitecore.net/sitecore_experience_platform/… have you gone through this? Also can you show what you're show config.aspx shows the configuration to be? Might be that you have multiple configs setting the strategy.Harrier
Thanks guys - update providedAsmara
In your crawling log file, can you search for the word "stopped" and see if anything comes up? We had an issue recently where our master index stopped crawling.Amethist
C
0

In order to guarantee Lucene files are not concurrently modified, Lucene adds a .lock file concept - whatever process is about to write, has to create the file. In case there is one already - wait for it to be removed.

Should a writer process be terminated, file never got removed, hence index never got updated.

The solution was to clean the folder manually.

In order to make a better prediction a memory snapshot of the process is needed to see what is happening inside (or what does each thread do).

Crossbill answered 21/11, 2019 at 15:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.