5

There are several sitecore indexing commit policy executor like Sitecore.ContentSearch.TimeIntervalCommitPolicy and Sitecore.ContentSearch.ModificationCountCommitPolicy

I want to know the difference between these two policies. I can't find much information on this in sitecore documentation.

6

Commit policies are the idea of telling the provider when it will finally commit documents into a persistent state so that if the application was to crash or the computer was to power down that you would be able to still search for those documents in the index when the application was started again. Common policies are to commit by document count, time, amount of ram buffered or document size count but in essence you have full control over the logic of when a commit will happen.

When you use TimeIntervalCommitPolicy it's commit your documents every 3 minutes.

public class TimeIntervalCommitPolicy : ICommitPolicy, IDisposable, ICloneable, ISearchIndexInitializable
    {
        //Sitecore 9 code 
        private readonly TimeSpan interval = new TimeSpan(0, 0, 5, 0);

When you use ModificationCountCommitPolicy you have "Limit" setting in configuration.

          <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
              <policies hint="list:AddCommitPolicy">
                <policy type="Sitecore.ContentSearch.ModificationCountCommitPolicy, Sitecore.ContentSearch">
                  <Limit>1000</Limit>
                </policy>
              </policies>
            </commitPolicyExecutor>

If the documents modified exceed the Limit from settings, documents are committed to the index.

Here is a described Commit policies for Sitecore 7: https://community.sitecore.net/technical_blogs/b/sitecore_7_development_team/posts/sitecore-7-commit-policies

On current version they work in the same way.

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.