首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sitecore 7索引配置问题

Sitecore 7索引配置问题
EN

Stack Overflow用户
提问于 2013-12-30 19:54:40
回答 1查看 3.2K关注 0票数 1

我们已经将Sitecore升级到7.0 rev.131127 (7.0 Update-3)。我们为每个索引创建了一个单独的配置文件,并且每个索引也有一些自定义字段。以下是配置文件的结构。

代码语言:javascript
复制
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <contentSearch>
      <configuration type="Sitecore.ContentSearch.LuceneProvider.LuceneSearchConfiguration, Sitecore.ContentSearch.LuceneProvider">
        <DefaultIndexConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider">
          <IndexAllFields>true</IndexAllFields>
          <Analyzer ref="contentSearch/configuration/defaultIndexConfiguration/analyzer" />
          <fields hint="raw:AddComputedIndexField">
            <field fieldName="word-search" storageType="NO" indexType="UN_TOKENIZED" vectorType="NO">LowerCaseTrimmedField, Project</field>
          <include hint="list:IncludeTemplate">
            <!--Notes Template-->
            <note>{21176496-CE68-48A0-860F-BB73CFB52D65}</note>
          </include>
          <indexFieldStorageValueFormatter type="Sitecore.ContentSearch.LuceneProvider.Converters.LuceneIndexFieldStorageValueFormatter, Sitecore.ContentSearch.LuceneProvider">
          </indexFieldStorageValueFormatter>
          <indexDocumentPropertyMapper type="Sitecore.ContentSearch.LuceneProvider.DefaultLuceneDocumentTypeMapper, Sitecore.ContentSearch.LuceneProvider" />
          <fieldReaders type="Sitecore.ContentSearch.FieldReaders.FieldReaderMap, Sitecore.ContentSearch">
          </fieldReaders>
        </DefaultIndexConfiguration>
        <indexes hint="list:AddIndex">
          <index id="IndexName" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
            <param desc="name">$(id)</param>
            <param desc="folder">$(id)</param>
            <!-- This initializes index property store. Id has to be set to the index id -->
            <param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)" />
            <strategies hint="list:AddStrategy">
              <!-- NOTE: order of these is controls the execution order -->
              <strategy ref="contentSearch/indexUpdateStrategies/intervalAsyncCore" />
            </strategies>
            <locations hint="list:AddCrawler">
              <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>core</Database>
                <Root>/sitecore/Root</Root>
              </crawler>
            </locations>
          </index>
        </indexes>
      </configuration>
    </contentSearch>
  </sitecore>
</configuration>

但是,当重新构建索引时,它会合并自定义字段,并将其他索引中的模板包含到该索引中。感谢您对此的意见。

Hi TwentyGotoTen,正如您所建议的,这里是来自/sitecore/admin/showconfig.aspx文件的合并后的contentsearch节点。为了方便起见,我删除了一些内容。我可以看到,配置文件中的所有默认配置都被合并到一个部分中,这就是这种奇怪行为背后的原因。可以做些什么来阻止这种情况的发生?

代码语言:javascript
复制
    <contentSearch patch:source="Index1.config">
    <configuration type="Sitecore.ContentSearch.LuceneProvider.LuceneSearchConfiguration, Sitecore.ContentSearch.LuceneProvider">
      <DefaultIndexConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider">
        <IndexAllFields>true</IndexAllFields>
        <Analyzer ref="contentSearch/configuration/defaultIndexConfiguration/analyzer"/>
        <include hint="list:IncludeTemplate">
          All included templates in config files
        </include>
        <fields hint="raw:AddComputedIndexField">
          All custom fields in config files
        </fields>
        <indexFieldStorageValueFormatter type="Sitecore.ContentSearch.LuceneProvider.Converters.LuceneIndexFieldStorageValueFormatter, Sitecore.ContentSearch.LuceneProvider">
        </indexFieldStorageValueFormatter>
        <indexDocumentPropertyMapper type="Sitecore.ContentSearch.LuceneProvider.DefaultLuceneDocumentTypeMapper, Sitecore.ContentSearch.LuceneProvider"/>
        <fieldReaders type="Sitecore.ContentSearch.FieldReaders.FieldReaderMap, Sitecore.ContentSearch">
        </fieldReaders>
        <fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch" patch:source="Index1.config">
        </fieldMap>
        <analyzer type="AllClassifieds.Web.extensions.indexing.Analysers.ClassifiedContentAnalyser" patch:source="Index1.config"/>

        <exclude hint="list:ExcludeTemplate" patch:source="Index1.config">
          All excluded templates in config files
        </exclude>
      </DefaultIndexConfiguration>
      <indexes hint="list:AddIndex">
        <index id="Index1" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
          <param desc="name">$(id)</param>
          <param desc="folder">$(id)</param>
          <!--
 This initializes index property store. Id has to be set to the index id 
-->
          <param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)"/>
          <strategies hint="list:AddStrategy">
            <!--
 NOTE: order of these is controls the execution order 
-->
            <strategy ref="contentSearch/indexUpdateStrategies/onPublishEndAsync"/>
          </strategies>
          <locations hint="list:AddCrawler">
            <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
              <Database>web</Database>
              <Root>/sitecore/Path</Root>
            </crawler>
          </locations>
        </index>
        <index id="Index2" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider" patch:source="Index1.config">
          <param desc="name">$(id)</param>
          <param desc="folder">$(id)</param>
          <!--
 This initializes index property store. Id has to be set to the index id 
-->
          <param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)"/>
          <strategies hint="list:AddStrategy">
            <!--
 NOTE: order of these is controls the execution order 
-->
            <strategy ref="contentSearch/indexUpdateStrategies/intervalAsyncMaster"/>
          </strategies>
          <locations hint="list:AddCrawler">
            <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
              <Database>master</Database>
              <Root>/sitecore/Path</Root>
            </crawler>
          </locations>
        </index>
      </indexes>
      <defaultIndexConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider" patch:source="Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config">

      </defaultIndexConfiguration>
    </configuration>
    <!--
 INDEXING STRATEGIES 
           Here is a list of the different indexing strategies that you can use. You can also combine these strategies to achieve what you want.

-->
    <indexUpdateStrategies patch:source="Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config">

    </indexUpdateStrategies>
    <databasePropertyStore type="Sitecore.ContentSearch.Maintenance.IndexDatabasePropertyStore, Sitecore.ContentSearch" patch:source="Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config">
      <Key>$(1)</Key>
      <Database>core</Database>
    </databasePropertyStore>
  </contentSearch>
EN

回答 1

Stack Overflow用户

发布于 2013-12-31 17:30:41

我怀疑这是包含文件的结构问题。

Sitecore刚刚制作了一份关于Sitecore配置修补的文档,其中说明了includes修补工具的所有功能和限制。

http://sdn.sitecore.net/Reference/Sitecore%207/Include%20File%20Patching%20Facilities.aspx

在其他地方也有大量关于这个主题的有用信息:

https://www.google.com/?q=sitecore+includes#q=sitecore+includes

我建议您查看这些资源,并确保您的包含文件设置正确。正如您所看到的,showconfig.aspx在调试配置问题方面是一个很有价值的工具,但是如果您仍然像Mark Ursino建议的那样遇到问题,那么您应该使用Sitecore支持。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20839010

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档