开发者

Sitecore search: new template field not being included in search index

开发者 https://www.devze.com 2023-04-04 08:28 出处:网络
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 templa

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>


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号