0

During (manually triggered) indexing of the master database, I get the following exception (stack trace below). Using Sitecore 8.2u7 with SXA 1.7.

27608 10:43:03 ERROR [Index=sitecore_master_index] Commit failed
Exception: System.AggregateException
Message: One or more errors occurred.
Source: mscorlib
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)
   at Sitecore.ContentSearch.Azure.Http.CompositeSearchService.PostDocuments(ICloudBatch batch)
   at Sitecore.ContentSearch.Azure.CloudSearchUpdateContext.Commit()

Nested Exception

Exception: Sitecore.ContentSearch.Azure.Http.Exceptions.PostFailedForSomeDocumentsException
Message: Partial success for insert or update. Some documents succeeded, but at least one failed.
Source: Sitecore.ContentSearch.Azure
   at Sitecore.ContentSearch.Azure.Http.SearchServiceClient.EnsureSuccessStatusCode(HttpResponseMessage response)
   at Sitecore.ContentSearch.Azure.Http.SearchServiceClient.PostDocuments(String jsonString)
   at Sitecore.ContentSearch.Azure.Http.SearchService.PostDocuments(ICloudBatch batch)
   at Sitecore.ContentSearch.Azure.Http.CompositeSearchService.<>c__DisplayClass15_0.<PostDocuments>b__0(ISearchService searchService)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

Nested Exception

Exception: Sitecore.ContentSearch.Azure.Http.Exceptions.AzureSearchServiceRESTCallException
Message: {"@odata.context":"https://wonkey-donkey.search.windows.net/indexes('sitecore-master-index')/$metadata#Collection(Microsoft.Azure.Search.V2016_09_01.IndexResult)","value":[{"key":"3cd50abca6dae4d4fe8174aeedddd81a","status":true,"errorMessage":null,"statusCode":201},

I've truncated the exception response from Azure for brevity, but the failing response of interest is

{
     "key":"aeaa7458b10a04593a6ef20bbbbc12f1",
     "status":false,
     "errorMessage":"Field 'content_1' contains a term that is too large to process. The max length for UTF-8 encoded terms is 32766 bytes. The most likely cause of this error is that filtering, sorting, and/or faceting are enabled on this field, which causes the entire field value to be indexed as a single term. Please avoid the use of these options for large fields.",
     "statusCode":400
},

I've tried searching that "key" value in Sitecore and it does not correspond to a template ID, so I assume this must be an ID for the field in Azure or a unique ID for the request/batch. Can anyone confirm what this is and whether I can use it to diagnose what is going on?

The field name "content_1" suggests to me that this is one of a number of duplicate field names and so the indexing code appends the number to make them unique. I don't have a "content 1" or "content_1" field anywhere in my solution. I have tried excluding from indexing all fields called "content", but I still get the same problem. I really don't know where this field is coming from as all fields named content have been excluded. I have also queried all items where a "content" field is not null or empty and have tried excluding the templates of the found items, but that does not resolve the error either. I am making a patch for defaultCloudIndexConfiguration which the other indexes reference via <configuration ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration">.

0

The field content_1 is not a template field. It is a computed field for indexing media items such as Word or PDF documents. My attempt to exclude fields named "content" was pointless!

I tried to patch:delete this computed field, but that caused another error:

Field 'content___s' contains a term that is too large to process. The max length for UTF-8 encoded terms is 32766 bytes. The most likely cause of this error is that filtering, sorting, and/or faceting are enabled on this field, which causes the entire field value to be indexed as a single term. Please avoid the use of these options for large fields.

My colleague Miguel pointed me to this Sitecore support ticket which should resolve the issue https://github.com/SitecoreSupport/Sitecore.Support.218625 (download here).

What we also found to work (although may affect search functionality in some way) is to add a patch file as below:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
  <sitecore>
    <contentSearch>
      <indexConfigurations>
        <defaultCloudIndexConfiguration type="Sitecore.ContentSearch.Azure.CloudIndexConfiguration, Sitecore.ContentSearch.Azure">
          <fieldMap type="Sitecore.ContentSearch.Azure.FieldMaps.CloudFieldMap, Sitecore.ContentSearch.Azure">
            <fieldNames hint="raw:AddFieldByFieldName">
              <field fieldName="_content">
                <patch:attribute name="facetable">NO</patch:attribute>
                <patch:attribute name="filterable">NO</patch:attribute>
                <patch:attribute name="sortable">NO</patch:attribute>
              </field>
              <field fieldName="text">
                <patch:attribute name="facetable">NO</patch:attribute>
                <patch:attribute name="filterable">NO</patch:attribute>
                <patch:attribute name="sortable">NO</patch:attribute>
              </field>
            </fieldNames>
          </fieldMap>
        </defaultCloudIndexConfiguration>
      </indexConfigurations>
    </contentSearch>
  </sitecore>
</configuration>

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.