Sitecore 搜索:新模板字段未包含在搜索索引中
我有一个现有的网站,带有 lucene 搜索,可以完美运行,但是由于向我的基本模板(所有其他页面模板继承的模板)添加了一个新字段(称为“内容”),因此似乎无法进行搜索这个新领域。
我已尝试以下操作:
- 执行“智能发布”
- 从 Sitecore 桌面的控制面板重建搜索索引
- 将
设置添加到我的网站的相应部分.configtrue
但我没有运气。有关背景信息,这里是我添加了
元素的 web.config 片段。 (此代码段位于 configuration\sitecore\search
下)
<configuration type="Sitecore.Search.SearchConfiguration, Sitecore.Kernel" singleInstance="true">
<indexes hint="list:AddIndex">
<index id="system" type="Sitecore.Search.Index, Sitecore.Kernel">
<param desc="name">$(id)</param>
<param desc="folder">__system</param>
<Analyzer ref="search/analyzer"/>
<locations hint="list:AddCrawler">
<core type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel">
<Database>core</Database>
<Root>/sitecore/content</Root>
<include hint="list:IncludeTemplate">
<application>{EB06CEC0-5E2D-4DC4-875B-01ADCC577D13}</application>
</include>
<Tags>application</Tags>
<Boost>2.0</Boost>
</core>
<core-controlpanel type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel">
<Database>core</Database>
<Root>/sitecore/content/applications/control panel</Root>
<include hint="list:IncludeTemplate">
<taskoption>{BDB6FA46-2F76-4BDE-8138-52B56C2FC47E}</taskoption>
</include>
<Tags>taskoption</Tags>
<Boost>1.9</Boost>
</core-controlpanel>
<master type="Sitecore.Search.Crawlers.DatabaseCrawler, Sitecore.Kernel">
<Database>master</Database>
<Tags>master content</Tags>
<IndexAllFields>true</IndexAllFields>
</master>
</locations>
</index>
</indexes>
</configuration>
I have an existing website with a lucene search which works perfectly adequately, however since adding a new field (called 'Content') to my base template (a template from which all other page templates inherit) it doesn't seem possible to search against this new field.
I have tried the following:
- doing a 'Smart Publish'
- Rebuilding the search index from the control panel in the Sitecore desktop
- adding an
<IndexAllFields>true</IndexAllFields>
setting to the appropriate section of my web.config
but I am having no luck. For background info here is the snippet of my web.config which I added the <IndexAllFields>
element to. (this snippet resides under configuration\sitecore\search
)
<configuration type="Sitecore.Search.SearchConfiguration, Sitecore.Kernel" singleInstance="true">
<indexes hint="list:AddIndex">
<index id="system" type="Sitecore.Search.Index, Sitecore.Kernel">
<param desc="name">$(id)</param>
<param desc="folder">__system</param>
<Analyzer ref="search/analyzer"/>
<locations hint="list:AddCrawler">
<core type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel">
<Database>core</Database>
<Root>/sitecore/content</Root>
<include hint="list:IncludeTemplate">
<application>{EB06CEC0-5E2D-4DC4-875B-01ADCC577D13}</application>
</include>
<Tags>application</Tags>
<Boost>2.0</Boost>
</core>
<core-controlpanel type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel">
<Database>core</Database>
<Root>/sitecore/content/applications/control panel</Root>
<include hint="list:IncludeTemplate">
<taskoption>{BDB6FA46-2F76-4BDE-8138-52B56C2FC47E}</taskoption>
</include>
<Tags>taskoption</Tags>
<Boost>1.9</Boost>
</core-controlpanel>
<master type="Sitecore.Search.Crawlers.DatabaseCrawler, Sitecore.Kernel">
<Database>master</Database>
<Tags>master content</Tags>
<IndexAllFields>true</IndexAllFields>
</master>
</locations>
</index>
</indexes>
</configuration>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现,如果您要搜索的文本保存在单行文本字段中,则需要将以下内容添加到configuration\sitecore\indexes\index\fields 下的 web.config 文件中:
此外,
true
元素仅适用于“新”样式搜索 API。I found out that if the text you are searching for is held in a Single-Line Text field, you need to add the following into your web.config file under configuration\sitecore\indexes\index\fields :
Also, the
<IndexAllFields>true</IndexAllFields>
element is only applicable to the 'new' style search API.