2

I reducing the number of fields which get indexed in my site.

I looked at App_Config\Include\Sitecore.ContentSearch.Azure.DefaultIndexConfiguration.config and see the section

<configuration
  <sitecore>
    <contentSearch>
      <indexConfigurations>
        <defaultCloudIndexConfiguration>
          <documentOptions>
            <exclude hint="list:AddExcludedField">
              <__display_name>{B5E02AD9-D56F-4C41-A065-A133DB87BDEB}</__display_name>

Then I looked at Sitecore.XA.Foundation.Search.Azure.DefaultIndexConfiguration.config (SXA 1.7.1 config file) and found this:

<configuration>
  <sitecore>
    <contentSearch>
      <indexConfigurations>
        <defaultIndexConfiguration>
          <exclude hint="list:ExcludeField">
            <LearnMoreTarget_A4270003 tag="{A4270003-480F-467A-BBEA-0D1B05B28656}">{A4270003-480F-467A-BBEA-0D1B05B28656}</LearnMoreTarget_A4270003>

What is the difference between excluding template fields within the documentOptions section vs excluding in the defaultIndexConfiguration section?

  • 1
    This may be a bug. I don't see ExcludeField on CloudIndexConfiguration or SolrIndexConfiguration. I do see AddExcludedField on IDocumentBuilderOptions. – Marek Musielak Jun 14 at 9:26
  • 1
    I see an ExcludeField method inside ProviderIndexConfiguration which is marked as [Obsolete]. It actually calls DocumentOptions.AddExcludedField so, in theory, should achieve the exact same thing. – Matthew Dresser Jun 14 at 10:29
  • 1
    I checked 9.1.0 rev. 001564 dll and ExcludeField is no longer there – Marek Musielak Jun 14 at 10:35
  • @MarekMusielak can you put an answer to the question please, I don't want this question to get deleted due to inactivity with no answer! – Mark Gibbons Jul 14 at 2:05
  • 1
    @MarkGibbons here you are. Answer created. – Marek Musielak Jul 14 at 8:26
2

There used to be ExcludeField method in ProviderIndexConfiguration in older Sitecore version. It was just calling DocumentOptions.AddExcludedField as Matthew Dresser wrote in his comment.

At some point it was marked as obsolete and finally it was removed.

In Sitecore 9.1.0 rev. 001564 dll method ExcludeField is no longer there.

AddExcludedField of IDocumentBuilderOptions should be used instead.

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.