我们已将Sitecore升级到7.0 rev.131127(7.0 Update-3)。 我们为每个索引创建了一个单独的配置文件,每个索引也有一些自定义字段。以下是配置文件的结构。
<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>
但是,当重建索引时,它会合并自定义字段,并将来自其他索引的模板包含到该索引中。感谢您对此的意见。
嗨TwentyGotoTen, 正如您在此处所建议的那样是来自/sitecore/admin/showconfig.aspx文件的合并内容搜索节点。为了方便,我删除了一些内容。我可以看到配置文件中的所有默认配置都合并到一个部分中,这就是这种奇怪行为背后的原因。有什么办法可以阻止这种情况发生?
<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>
答案 0 :(得分:1)
我怀疑这是包含文件结构的问题。
Sitecore刚刚制作了一份关于Sitecore配置修补的文档,该文档说明了包含修补工具的所有功能和限制。
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支持提出一张票。