5

While configuring cd instance on SOLR one has to remove index update strategies and set to manual from index definitions on cd server.

Can we do that using sitecore patching?

11

You can use <patch:delete /> to achieve this. It will look like:

<sitecore>
  <contentSearch>
      <configuration>
        <indexes>
          <index id="xxxxx">
            <strategies hint="list:AddStrategy">
                <patch:delete />
            </strategies>
            <strategies hint="list:AddStrategy"> 
                <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies‌​/manual" /> 
            </strategies>
            </index>    
        </indexes>
    </configuration>    
  </contentSearch>
</sitecore>
  • thanks, this would look like that if I want to add manual strategy: <strategies hint="list:AddStrategy"> <patch:delete/> </strategies> <strategies hint="list:AddStrategy"> <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" /> </strategies> / can you add that to an answer please? – Andrey Bobrov Jan 19 '17 at 10:14
  • Hey @AndreyBobrov, what do you mean? You question asked to "remove index update strategies". Do you have multiple <strategies> elements? – josedbaez Jan 19 '17 at 10:26
  • in order to disable the strategy you have to set it to manual as well, please check my question – Andrey Bobrov Jan 19 '17 at 10:29
  • please check updated question – Andrey Bobrov Jan 19 '17 at 10:31
  • Answer amended. – josedbaez Jan 19 '17 at 10:35
1

You can remove the original strategy and add strategy with same name just using ManualStrategy type:

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <contentSearch>
      <indexConfigurations>
        <indexUpdateStrategies>
          <intervalAsyncMaster>
            <patch:delete />
          </intervalAsyncMaster>
          <intervalAsyncMaster type="Sitecore.ContentSearch.Maintenance.Strategies.ManualStrategy, Sitecore.ContentSearch" />
        </indexUpdateStrategies>
      </indexConfigurations>
    </contentSearch>
  </sitecore>
</configuration>

You need to repeat that for all the strategies.

Thanks to that you don't worry how many indexes there are and if anyone else adds a new index later. They will use manual on CD servers always.

  • I consider this quite dangerous and confusing. the below answer is more correct for my case. However removing asyncMaster strategy is a good practice for cd env – Andrey Bobrov Jan 19 '17 at 10:16
  • 1
    I don't understand why you say it's dangerous. CD servers should NEVER update indexes when you use Solr. It's safer than you expect ;) – Marek Musielak Jan 19 '17 at 10:19

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.