Sitecore > Commerce index can't be rebuilt right after the catalog update

790 Views Asked by At

I have a following task: update commerce catalog(full refresh using xml file) and rebuild commerce indexes after that(commerce_products_web_index,commerce_products_master_index). Our solution is using a Solr provider at the moment. Both commerce indexes(above) have "Manual" index rebuild strategy in the config files.

Current issue: After successful commerce catalog full refresh I am trying to rebuild commerce indexes one by one(checking status of the index job).

Job job = IndexCustodian.FullRebuild(ContentSearchManager.GetIndex(indexName), true);

First index is not rebuilt at the moment in a correct way. It contains only root item(catalog name) in all configured languages. The second index has all required products and categories. "First" means - first index in the list by order. If I change the order of indexes - the problem will be the same and not related to some specific index.

In crawling logs I found lots of errors related to missed items(during the rebuilding of the first index). As I understand, old items(products/categories) have been removed on catalog refresh, however Sitecore still is trying to find them(to index) using their ExternalIds:

    10252 13:31:15 WARN  Crawler : Add failed - 6d7291fb-8b92-4f67-b4c4-0b72b608c907
Exception: System.ArgumentNullException
Message: Value cannot be null.
Parameter name: item
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)
   at Sitecore.ContentSearch.SitecoreIndexableItem..ctor(Item item)
   at Sitecore.Commerce.Connect.CommerceServer.Search.CatalogCrawler.DoAdd(IProviderUpdateContext context, CommerceIndexableItem indexable)
   at Sitecore.ContentSearch.FlatDataCrawler`1.<>c__DisplayClassc.<Add>b__9(T indexable, ParallelLoopState loopState)

Is it related to a data provider which automatically adds references to products in commerce catalog to Sitecore tree? As I know Sitecore doesn't store these data in its DBs, but just gets data directly from Commerce Catalog(with some cache configured). Has anybody faced with a similar issue?

I would appreciate any advice.

Thank you in advance.

0

There are 0 best solutions below