8

I got a trouble about custom index with Sitecore 9.0.1 in Azure. My custom index configuration can rebuild successfully and this index can create in Azure search with Sitecore 9.0.

After I changed to use Sitecore 9.0.1 this configuration didn't work anymore. The index builds successfully but it cannot be created in Azure. I didn't get any exception in UI or log. The Sitecore default index can build and create successfully without trouble. I'm very appreciate your help about it.

Below is my custom index configuration

<sitecore role:require="Standalone or ContentManagement or ContentDelivery" search:require="Azure">
<contentSearch>
  <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
    <indexes hint="list:AddIndex">
      <index id="generalredirects_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>

        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/generalRedirectsSearchConfiguration" />
        <schemaBuilder ref="contentSearch/searchServiceSchemaBuilder" />
        <searchService type="Sitecore.ContentSearch.Azure.Http.CompositeSearchService, Sitecore.ContentSearch.Azure"/>
        <strategies hint="list:AddStrategy">
          <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/TUVSUD/Storage/General Redirects</Root>
          </crawler>
        </locations>
        <enableItemLanguageFallback>false</enableItemLanguageFallback>
        <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
      </index>
      <index id="generalredirects_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>           
        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/generalRedirectsSearchConfiguration" />
        <schemaBuilder ref="contentSearch/searchServiceSchemaBuilder" />
        <searchService type="Sitecore.ContentSearch.Azure.Http.CompositeSearchService, Sitecore.ContentSearch.Azure"/>
        <strategies hint="list:AddStrategy">
          <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/TUVSUD/Storage/General Redirects</Root>
          </crawler>
        </locations>
        <enableItemLanguageFallback>false</enableItemLanguageFallback>
        <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
      </index>
    </indexes>
  </configuration>
</contentSearch>   

 <sitecore>
<contentSearch>
  <indexConfigurations>
    <generalRedirectsSearchConfiguration type="Sitecore.ContentSearch.Azure.CloudIndexConfiguration, Sitecore.ContentSearch.Azure">
      <initializeOnAdd>true</initializeOnAdd>
      <fieldMap ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/fieldMap">
        <fieldNames hint="raw:AddFieldByFieldName">
          <field fieldName="destinationurl" cloudFieldName="destinationurl_s" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure">ACB.Feature.GeneralRedirects.Indexing.Fields.DestinationUrl,ACB.Feature.GeneralRedirects</field>
          <field fieldName="sourceurl" cloudFieldName="sourceurl_s" boost="1f" type="System.String"  settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure">ACB.Feature.GeneralRedirects.Indexing.Fields.SourceUrl,ACB.Feature.GeneralRedirects</field>
          <field fieldName="redirecttype" cloudFieldName="redirecttype_tl" boost="1f" type="System.Int32" settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure">ACB.Feature.GeneralRedirects.Indexing.Fields.RedirectType,ACB.Feature.GeneralRedirects</field>
          <field fieldName="querystring" cloudFieldName="querystring_s" boost="1f" type="System.String"  settingType="Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure">ACB.Feature.GeneralRedirects.Indexing.Fields.QueryString,ACB.Feature.GeneralRedirects</field>
        </fieldNames>
      </fieldMap>
      <fieldReaders ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/fieldReaders" />
      <virtualFields ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/virtualFields" />
      <documentOptions ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/documentOptions">
        <indexAllFields>false</indexAllFields>
        <fields hint="raw:AddComputedIndexField">
          <field fieldName="destinationurl">ACB.Feature.GeneralRedirects.Indexing.Fields.DestinationUrl,ACB.Feature.GeneralRedirects</field>
          <field fieldName="sourceurl">ACB.Feature.GeneralRedirects.Indexing.Fields.SourceUrl,ACB.Feature.GeneralRedirects</field>
          <field fieldName="redirecttype">ACB.Feature.GeneralRedirects.Indexing.Fields.RedirectType,ACB.Feature.GeneralRedirects</field>
          <field fieldName="querystring">ACB.Feature.GeneralRedirects.Indexing.Fields.QueryString,ACB.Feature.GeneralRedirects</field>
        </fields>
        <include hint="list:AddIncludedTemplate">
          <InternalRedirect>{48710E43-17E6-4179-9B8D-7C8994737F06}</InternalRedirect>
          <ExternalRedirect>{A08BEFB2-C24E-4A1E-B619-9C9AB4F6C4B9}</ExternalRedirect>
          <ObsoleteRedirect>{4150ADEE-C8D0-4275-8A61-9C78AF897E03}</ObsoleteRedirect>
        </include>
      </documentOptions>



      <indexFieldStorageValueFormatter ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/indexFieldStorageValueFormatter" />

      <indexDocumentPropertyMapper ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/indexDocumentPropertyMapper"/>

      <documentBuilderType ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/documentBuilderType"/>

      <defaultSearchSecurityOption ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/defaultSearchSecurityOption" />

      <cloudTypeMapper ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration/cloudTypeMapper"/>

    </generalRedirectsSearchConfiguration>
  </indexConfigurations>
</contentSearch>

  • thanks that was reaaaally helpful, I had the same issue on Sitecore 9.0.1 and your suggestion fixed it. – damary Feb 4 at 13:40
8

I fixed this issue. You should use

<generalRedirectsSearchConfiguration ref="contentSearch/indexConfigurations/defaultCloudIndexConfiguration">

instead of using

<generalRedirectsSearchConfiguration type="Sitecore.ContentSearch.Azure.CloudIndexConfiguration, Sitecore.ContentSearch.Azure">

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.