1

I have implemented Sitecore Suggesting search on Sitecore 9.2. based on https://sitecore.namics.com/2018/06/15/sitecore-9-azure-search-suggestions/ but when I rebuild indexes, I am getting error:

Job started: Index_Update_IndexName=custom-master-index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> Sitecore.ContentSearch.Azure.Http.Exceptions.BadRequestException: Error in the request URI, headers, or body ---> Sitecore.ContentSearch.Azure.Http.Exceptions.AzureSearchServiceRESTCallException: {"error":{"code":"","message":"This index has suggesters defined in it that cannot be removed. This error is caused by attempting to update an index without including all of its existing suggesters or by attempting to update an index that was created/updated with a newer version of the API."}} --- End of inner exception stack trace ---

Error happend here at update logic:

 protected override IndexDefinition SyncRemoteService(IndexDefinition sourceIndexDefinition, IEnumerable<IndexedField> incomingFields)
        {
            IEnumerable<IndexedField> mainFields = sourceIndexDefinition?.Fields ?? (IEnumerable<IndexedField>)new List<IndexedField>();
            incomingFields = incomingFields ?? (IEnumerable<IndexedField>)new List<IndexedField>();
            bool isModified1;
            IEnumerable<IndexedField> indexedFields = this.MergeFields(mainFields, incomingFields, out isModified1);
            if (!isModified1 && sourceIndexDefinition != null)
                return new IndexDefinition(sourceIndexDefinition.AnalyzerDefinitions, indexedFields);
            var index = this.ManagmentOperations.GetIndex();
            if (index == null)
            {
                IndexDefinition indexDefinition = new CloudIndexDefinition(this.AnalyzerRepository.GetAnalyzers(), indexedFields);
                this.ManagmentOperations.CreateIndex(indexDefinition);
                return indexDefinition;
            }
            bool isModified2;
            IEnumerable<IndexedField> fields = this.MergeFields(index.Fields, indexedFields, out isModified2);
            var indexDefinition1 = new CloudIndexDefinition(index.AnalyzerDefinitions, fields);
            if (isModified2)
                this.ManagmentOperations.UpdateIndex(indexDefinition1);
            return indexDefinition1;
        }

I tried different api versions to at cloud.search, but issue is the same.

any advice ?

  • Hi , Can you try recreating the index in Azure and then rebuild index? – Abhay Dhar Jan 20 at 13:09
  • @AbhayDhar i did but issue is repeating – Arbejdsglæde Jan 21 at 15:24
  • Are you sure that you have also properly patched the configuration based on this file gist.github.com/error505/… ? – Peter Procházka Jan 23 at 20:19
  • @PeterProcházka yes I have it at configs – Arbejdsglæde Jan 24 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.