【问题标题】:Sitecore search: new template field not being included in search indexSitecore 搜索:新模板字段未包含在搜索索引中
【发布时间】:2011-09-09 17:53:54
【问题描述】:

我有一个带有 lucene 搜索的现有网站,它可以完美运行,但是由于向我的基本模板(所有其他页面模板继承的模板)添加了一个新字段(称为“内容”),这似乎是不可能的来搜索这个新字段。

我尝试了以下方法:

  • 进行“智能发布”
  • 从 Sitecore 桌面的控制面板重建搜索索引
  • <IndexAllFields>true</IndexAllFields> 设置添加到我的 web.config 的相应部分

但我没有运气。对于背景信息,这里是我添加了<IndexAllFields> 元素的 web.config 的 sn-p。 (这个 sn-p 位于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>

【问题讨论】:

    标签: search lucene sitecore sitecore6


    【解决方案1】:

    我发现如果您要搜索的文本保存在单行文本字段中,您需要在 web.config 文件的 configuration\sitecore\indexes\index\fields 下添加以下内容:

    <type storage="unstored" stripTags="true">single-line text</type>
    

    另外,&lt;IndexAllFields&gt;true&lt;/IndexAllFields&gt; 元素仅适用于“新”样式搜索 API。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-13
      • 2015-08-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多