Sitecore 搜索:新模板字段未包含在搜索索引中

发布于 2024-12-03 13:43:16 字数 2267 浏览 1 评论 0原文

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

我已尝试以下操作:

  • 执行“智能发布”
  • 从 Sitecore 桌面的控制面板重建搜索索引
  • true 设置添加到我的网站的相应部分.config

但我没有运气。有关背景信息,这里是我添加了 元素的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魔法唧唧 2024-12-10 13:43:16

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

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

此外, 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 :

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

Also, the <IndexAllFields>true</IndexAllFields> element is only applicable to the 'new' style search API.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文