4

It looks similar to this post, but it's not Sitecore Azure Search - Invalid field name

In Azure Paas, Sitecore control panel, I am trying to index my custom search index 'generic_search_master' and resulted to the exception below.

enter image description here

I have made sure that:

  1. All the SOLR configurations are disabled
  2. All the Lucene configurations are disabled
  3. I have a valid Azure Search configurations and the AS search service is running.
  4. Upon first index, I were able to create the index in the Azure Search(AS)

enter image description here

Here's the detailed exception:

Job started: Index_Update_IndexName=generic_search_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.PostFailedForSomeDocumentsException: Partial success for insert or update. Some documents succeeded, but at least one failed. ---> Sitecore.ContentSearch.Azure.Http.Exceptions.AzureSearchServiceRESTCallException: {"@odata.context":"https://mc-9530421c-75e9-4777-9b33-641990-as.search.windows.net/indexes('generic-search-master-index')/$metadata#Collection(Microsoft.Azure.Search.V2015_02_28_Preview.IndexResult)","value":[{"key":"c156f09751a986f6c283a5cc48bcfc47","status":true,"errorMessage":null,"statusCode":201},

{"key":"b15682fcc820505777bdc5596c216698","status":true,"errorMessage":null,"statusCode":201},
{"key":"4518ce8a3ac943a1d5d8a83e5485248d","status":true,"errorMessage":null,"statusCode":201},
{{"key":"79bf8fd967b502c0bc24ccfb75f57b80","status":true,"errorMessage":null,"statusCode":201},
{"key":"4e22b0aabda715bb054afb4d12a0bc0d","status":true,"errorMessage":null,"statusCode":201},
{"key":"be738a7bf350b3bc7fbb7ae7d2f9b5ab","status":false,"errorMessage":"Field 'content__' 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},
{"key":"defc47224ae52ff82d0aabe3ca0b2776","status":true,"errorMessage":null,"statusCode":201},
{"key":"75814565d0bf12ee3995115d9dacf47d","status":true,"errorMessage":null,"statusCode":201},
{"key":"856ec2fb361cd5a40d46486e5106f73a","status":true,"errorMessage":null,"statusCode":201},
{"key":"2466c81cb2cdecb0a30bb06e0bd7120c","status":true,"errorMessage":null,"statusCode":201}

   --- End of inner exception stack trace ---
   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__DisplayClass11_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 )
   --- End of inner exception stack trace ---
   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()
   at Sitecore.ContentSearch.Azure.CloudSearchProviderIndex.DoRebuild(IndexingOptions indexingOptions)
   at Sitecore.ContentSearch.Azure.CloudSearchProviderIndex.PerformRebuild(IndexingOptions indexingOptions, CancellationToken cancellationToken)
   at Sitecore.ContentSearch.Azure.CloudSearchProviderIndex.Rebuild(IndexingOptions indexingOptions)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
   at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.Jobs.Job.ThreadEntry(Object state)

Here's my index configuration

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
   <contentSearch>
     <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
       <indexes hint="list:AddIndex">
         <index id="generic_search_master_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
            <param desc="name">$(id)</param>
            <param desc="connectionStringName">cloud.search</param>
            <param desc="totalParallelServices">5</param>
            <!-- This initializes index property store. Id has to be set to the index id -->
            <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
            <configuration ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration" />
            <schemaBuilder ref="contentSearch/searchServiceSchemaBuilder" />
            <searchService type="Sitecore.ContentSearch.Azure.Http.CompositeSearchService, Sitecore.ContentSearch.Azure"/>
            <strategies hint="list:AddStrategy">
              <!-- NOTE: order of these is controls the execution order -->
              <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/syncMaster" />
            </strategies>
            <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
              <policies hint="list:AddCommitPolicy">
                <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
                <policy type="Sitecore.ContentSearch.ModificationCountCommitPolicy, Sitecore.ContentSearch">
                  <Limit>1000</Limit>
                </policy>
              </policies>
            </commitPolicyExecutor>
            <locations hint="list:AddCrawler">
              <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>master</Database>
                <Root>/sitecore/content/PROJECTABC</Root>
              </crawler>
            </locations>
            <enableItemLanguageFallback>false</enableItemLanguageFallback>
            <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
          </index>
          <index id="generic_search_web_index" type="Sitecore.ContentSearch.Azure.CloudSearchProviderIndex, Sitecore.ContentSearch.Azure">
            <param desc="name">$(id)</param>
            <param desc="connectionStringName">cloud.search</param>
            <param desc="totalParallelServices">5</param>
            <!-- This initializes index property store. Id has to be set to the index id -->
            <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
            <configuration ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration" />
            <schemaBuilder ref="contentSearch/searchServiceSchemaBuilder" />
            <searchService type="Sitecore.ContentSearch.Azure.Http.CompositeSearchService, Sitecore.ContentSearch.Azure"/>
            <strategies hint="list:AddStrategy">
              <!-- NOTE: order of these is controls the execution order -->
              <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/syncMaster" />
            </strategies>
            <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
              <policies hint="list:AddCommitPolicy">
                <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
                <policy type="Sitecore.ContentSearch.ModificationCountCommitPolicy, Sitecore.ContentSearch">
                  <Limit>1000</Limit>
                </policy>
              </policies>
            </commitPolicyExecutor>
            <locations hint="list:AddCrawler">
              <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>web</Database>
                <Root>/sitecore/content/PROJECTABC</Root>
              </crawler>
            </locations>
            <enableItemLanguageFallback>false</enableItemLanguageFallback>
            <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
          </index>
        </indexes>
      </configuration>
    </contentSearch>
    <solutionFramework>
      <indexing>
        <providers>
          <add name="pagecontents" type="PROJECTABC.Feature.PageContent.Indexing.PageContentIndexingProvider, PROJECTABC.Feature.PageContent" patch:before="add[@name='fallback']" />
        </providers>
      </indexing>
    </solutionFramework>
  </sitecore>
</configuration>

And also this: (I have commented out the field mapping for troubleshooting, but regardless if it's commented out or not, I still received the issue.)

<?xml version="1.0" encoding="utf-8" ?>
<!--

Purpose: This include file configures the Lucene index that is used by Social Connected to search for messages.

You must disable this include file on Sitecore instances that use SOLR.

To disable this include file, rename it to have a ".disabled" extension.

-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <contentSearch>
      <indexConfigurations>
        <genericSearchConfiguration ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration">

          <!-- <indexAllFields>false</indexAllFields>
          <initializeOnAdd>false</initializeOnAdd> -->

          <fieldMap ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/fieldMap">
            <fieldNames hint="raw:AddFieldByFieldName">
              <!-- template fields -->
              <!-- <fieldType fieldName="item published"       cloudFieldName="item_published"       boost="1f" type="System.Boolean"  settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure"/>
              <fieldType fieldName="post automatically"   cloudFieldName="post_automatically"   boost="1f" type="System.Boolean"  settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure"/> -->
              <!-- computed fields -->
              <!-- <fieldType fieldName="container"            boost="1f" type="System.String"   settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure"/>
              <fieldType fieldName="created date"         cloudFieldName="created_date"         boost="1f" type="System.DateTime" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure"/>
              <fieldType fieldName="final workflow state" cloudFieldName="final_workflow_state" boost="1f" type="System.Boolean"  settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure"/>
              <fieldType fieldName="posted date"          cloudFieldName="posted_date"          boost="1f" type="System.DateTime" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure"/>
              <fieldType fieldName="social account"       cloudFieldName="social_account"       boost="1f" type="Sitecore.Data.ID, Sitecore.Kernel" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure"/>
              <fieldType fieldName="workflow state"       cloudFieldName="workflow_state"       boost="1f" type="Sitecore.Data.ID, Sitecore.Kernel" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure"/> -->
            </fieldNames>
          </fieldMap>


          <exclude hint="list:ExcludeField">
            <__Created>{25BED78C-4957-4165-998A-CA1B52F67497}</__Created>
            <__DefaultWorkflow>{CA9B9F52-4FB0-4F87-A79F-24DEA62CDA65}</__DefaultWorkflow>
            <__Lock>{001DD393-96C5-490B-924A-B0F25CD9EFD8}</__Lock>
            <__LongDescription>{577F1689-7DE4-4AD2-A15F-7FDC1759285F}</__LongDescription>
            <__Originator>{F6D8A61C-2F84-4401-BD24-52D2068172BC}</__Originator>
            <__Owner>{52807595-0F8F-4B20-8D2A-CB71D28C6103}</__Owner>
            <__ReadOnly>{9C6106EA-7A5A-48E2-8CAD-F0F693B1E2D4}</__ReadOnly>
            <__Renderings>{F1A1FE9E-A60C-4DDB-A3A0-BB5B29FE732E}</__Renderings>
            <__Revision>{8CDC337E-A112-42FB-BBB4-4143751E123F}</__Revision>
            <__Security>{DEC8D2D5-E3CF-48B6-A653-8E69E2716641}</__Security>
            <__ShortDescription>{9541E67D-CE8C-4225-803D-33F7F29F09EF}</__ShortDescription>
            <__SortOrder>{BA3F86A2-4A1C-4D78-B63D-91C2779C1B5E}</__SortOrder>
            <__Source>{1B86697D-60CA-4D80-83FB-7555A2E6CE1C}</__Source>
            <__Updated>{D9CF14B1-FA16-4BA6-9288-E8A174D4D522}</__Updated>
            <__UpdatedBy>{BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}</__UpdatedBy>
            <__ValidFrom>{C8F93AFE-BFD4-4E8F-9C61-152559854661}</__ValidFrom>
            <__Workflow>{A4F985D9-98B3-4B52-AAAF-4344F6E747C6}</__Workflow>
            <ArchiveDate>{56C15C6D-FD5A-40CA-BB37-64CEEC6A9BD5}</ArchiveDate>
            <ArchiveVersionDate>{1D99005E-65CA-45CA-9D9A-FD7016E23F1E}</ArchiveVersionDate>
            <Boost>{93D1B217-B8F4-462E-BABF-68298C9CE667}</Boost>
            <BucketParentReference>{9DAFCA1D-D618-4616-86B8-A8ACD6B28A63}</BucketParentReference>
            <Cacheable>{3D08DB46-2267-41B0-BC52-BE69FD618633}</Cacheable>
            <ContextMenu>{D3AE7222-425D-4B77-95D8-EE33AC2B6730}</ContextMenu>
            <Controller>{4C9312A5-2E4E-42F8-AB6F-B8DB8B82BF22}</Controller>
            <ControllerAction>{9FB734CC-8952-4072-A2D4-40F890E16F56}</ControllerAction>
            <DefaultBucketQuery>{AC51462C-8A8D-493B-9492-34D1F26F20F1}</DefaultBucketQuery>
            <DefaultView>{3607F9C7-DDA3-43C3-9720-39A7A5B3A4C3}</DefaultView>
            <Editor>{D85DB4EC-FF89-4F9C-9E7C-A9E0654797FC}</Editor>
            <Editors>{A0CB3965-8884-4C7A-8815-B6B2E5CED162}</Editors>
            <EnabledViews>{F2DB8BA1-E477-41F5-8EF5-22EEFA8D2F6E}</EnabledViews>
            <Facets>{21F74F6E-42D4-42A2-A4B4-4CEFBCFBD2BB}</Facets>
            <HelpLink>{56776EDF-261C-4ABC-9FE7-70C618795239}</HelpLink>
            <Hidden>{39C4902E-9960-4469-AEEF-E878E9C8218F}</Hidden>
            <HideVersion>{B8F42732-9CB8-478D-AE95-07E25345FB0F}</HideVersion>
            <Icon>{06D5295C-ED2F-4A54-9BF2-26228D113318}</Icon>
            <Masters>{1172F251-DAD4-4EFB-A329-0C63500E4F1E}</Masters>
            <NeverPublish>{9135200A-5626-4DD8-AB9D-D665B8C11748}</NeverPublish>
            <PersistentFilter>{C7815F60-96E1-40CB-BB06-B5F833F73B61}</PersistentFilter>
            <Preview>{41C6CC0E-389F-4D51-9990-FE35417B6666}</Preview>
            <Publish>{86FE4F77-4D9A-4EC3-9ED9-263D03BD1965}</Publish>
            <ReminderDate>{ABE5D54C-59D7-41E6-8D3F-C1A3E4EC9B9E}</ReminderDate>
            <ReminderText>{BB6C8540-118E-4C49-9157-830576D7345A}</ReminderText>
            <Renderers>{B03569B1-1534-43F2-8C83-BD064B7D782C}</Renderers>
            <Ribbon>{0C894AAB-962B-4A84-B923-CB24B05E60D2}</Ribbon>
            <Skin>{079AFCFE-8ACA-4863-BDA7-07893541E2F5}</Skin>
            <Style>{A791F095-2521-4B4D-BEF9-21DDA221F608}</Style>
            <SubItemSorting>{6FD695E7-7F6D-4CA5-8B49-A829E5950AE9}</SubItemSorting>
            <SuppressedValidationRules>{F47C0D78-61F9-479C-96DF-1159727D32C6}</SuppressedValidationRules>
            <UnPublish>{7EAD6FD6-6CF1-4ACA-AC6B-B200E7BAFE88}</UnPublish>
            <UserAgent>{4E678FC0-8D35-4AB7-BB49-156F33C8B955}</UserAgent>
            <ValidTo>{4C346442-E859-4EFD-89B2-44AEDF467D21}</ValidTo>
            <VaryByData>{8B6D532B-6128-4486-A044-CA06D90948BA}</VaryByData>
            <VaryByDevice>{C98CF969-BA71-42DA-833D-B3FC1368BA27}</VaryByDevice>
            <VaryByLogin>{8D9232B0-613F-440B-A2FA-DCDD80FBD33E}</VaryByLogin>
            <VaryByParam>{3AD2506A-DC39-4B1E-959F-9D524ADDBF50}</VaryByParam>
            <VaryByQueryString>{1084D3D2-0457-456A-ABBC-EB4CC0966072}</VaryByQueryString>
            <VaryByUser>{0E54A8DC-72AD-4372-A7C7-BB4773FAD44D}</VaryByUser>
            <VaryByIndex>{F3E7E552-D7C8-469B-A150-69E4E14AB35C}</VaryByIndex>
          </exclude>

          <fields hint="raw:AddComputedIndexField">
            <field fieldName="title" returnType="text">PROJECTABC.Feature.PageContent.Indexing.Fields.Title,PROJECTABC.Feature.PageContent</field>
            <field fieldName="heading" returnType="text">PROJECTABCFeature.PageContent.Indexing.Fields.Heading,PROJECTABC.Feature.PageContent</field>
            <field fieldName="subheading" returnType="text">PROJECTABC.Feature.PageContent.Indexing.Fields.SubHeading,PROJECTABC.Feature.PageContent</field>
            <field fieldName="contentbody" returnType="text">PROJECTABC.Feature.PageContent.Indexing.Fields.ContentBody,PROJECTABC.Feature.PageContent</field>
            <field fieldName="contentimagealt" returnType="text">PROJECTABC.Feature.PageContent.Indexing.Fields.ContentImageAlt,PROJECTABC.Feature.PageContent</field>
            <field fieldName="contentimagetitle" returnType="text">PROJECTABC.Feature.PageContent.Indexing.Fields.ContentImageTitle,PROJECTABC.Feature.PageContent</field>
            <field fieldName="pagecontenttag" returnType="text">PROJECTABC.Feature.PageContent.Indexing.Fields.Tag,PROJECTABC.Feature.PageContent</field>
          </fields>  

        </genericSearchConfiguration>
      </indexConfigurations>
    </contentSearch>
  </sitecore>
</configuration>

Somewhere in the error logs, it says it's a 400 - bad request:

{"key":"be738a7bf350b3bc7fbb7ae7d2f9b5ab","status":false,"errorMessage":"Field 'content__' 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},

..but i don't have such field with 'content_' in it.

Note that this is only happening in Azure, as I've required to replace my Solr configurations with Azure search configurations.

  • what Sitecore version do you use? if 8.2 contact sitecore support. in the time being exclude the content__ from the indexing – Naim Alkouki Nov 8 '17 at 20:54
  • 1
    Did you ever find a solution to this issue? – Dan Sinclair Apr 25 '19 at 14:31
1

Your index is referencing the "contentSearch/indexConfigurations/defaultCloudIndexConfiguration" for configuration. This is defined in Sitecore.ContentSearch.Azure.DefaultIndexConfiguration in the Sitecore content search configs. Check this default configuration and you should see some field definition as below based on your version of sitecore.

<field fieldName="somefield"             cloudFieldName="somecloudfieldname"          searchable="YES"  retrievable="NO"   facetable="YES"  filterable="YES"  sortable="YES"  boost="1f" type="System.String"   settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure" />

Check for your content__ field in there and probably you have these facetable,filterable,sortable set to YES for this field. Check with Sitecore whether it can be turned off and turn it off and reindex. You may have to delete the Azure index and do indexing for the updates to take place.

| improve this answer | |

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.