1

我在我的 sitecore 网站中集成了 lucene 搜索,该网站在内容树的内容项下还有一个网站。我searchindex.configapp_congif/include folder. 我还更改了 lucenesearch 源以获取 siteroot 作为

SiteRoot = database.GetItem("/sitecore/content");

但搜索不起作用。表明:

找不到结果项

这意味着它没有在/Standard_Items/Search_Results. 这是我的searchindex.config

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
 <sitecore>
   <database>
    <database id="master">
     <Engines.HistoryEngine.Storage>
      <obj type="Sitecore.Data.$(database).$(database)HistoryStorage,Sitecore.Kernel">
        <param connectionStringName="$(id)"/>
        <EntryLifeTime>30.00:00:00</EntryLifeTime>
      </obj>
    </Engines.HistoryEngine.Storage>     <Engines.HistoryEngine.SaveDotNetCallStack>false</Engines.HistoryEngine.SaveDotNetCallStack>
  </database>
</database>
<search>
  <configuration>
    <indexes>
      <index id="SearchIndex" type="Sitecore.Search.Index, Sitecore.Kernel">
        <param desc="name">$(id)</param>
        <param desc="folder">search_index</param>
        <Analyzer ref="search/analyzer"/>
        <locations hint="list:AddCrawler">
          <resources type="Sitecore.Search.Crawlers.DatabaseCrawler, Sitecore.Kernel">
            <Database>master</Database>

            <Root>/sitecore/content</Root>
            <include hint="list:IncludeTemplate">
               <template>{2A609D52-7B9F-49F3-83BE-047FD16397A7} </template>
              <template>{F98712D8-27DB-4324-82E6-65242F0977F9} </template>
              <template>{849CA304-3F51-4FCB-B9B3-2AC7E950B476} </template>
            <template>{A87A00B1-E6DB-45AB-8B54-636FEC3B5523} </template>
            <template>{52BDB3C4-0585-437C-89AD-6AAC81950633} </template>

            </include>
            <IndexAllFields>true</IndexAllFields>
            <Boost>2.0</Boost>
          </resources>
        </locations>
      </index>
    </indexes>
  </configuration>
  </search>
 </sitecore>
</configuration>

这是我的内容树。我想在 sitecore/content/DruBlue 中搜索。

在此处输入图像描述

谁能帮帮我吗 ?

4

1 回答 1

6

您的配置中有错误:

<include hint="list:IncludeTemplate">
    <template>{2A609D52-7B9F-49F3-83BE-047FD16397A7} </template>
    <template>{F98712D8-27DB-4324-82E6-65242F0977F9} </template>
    <template>{849CA304-3F51-4FCB-B9B3-2AC7E950B476} </template>
    <template>{A87A00B1-E6DB-45AB-8B54-636FEC3B5523} </template>
    <template>{52BDB3C4-0585-437C-89AD-6AAC81950633} </template>
</include>

这部分将只包括{52BDB3C4-0585-437C-89AD-6AAC81950633}模板,因为它们都具有相同的标签名称。您需要为每个标签使用不同的标签(无论您使用template1, template2... 还是news, article, event,例如:

<include hint="list:IncludeTemplate">
    <template1>{2A609D52-7B9F-49F3-83BE-047FD16397A7}</template1>
    <template2>{F98712D8-27DB-4324-82E6-65242F0977F9}</template2>
    <article>{849CA304-3F51-4FCB-B9B3-2AC7E950B476}</article>
    <news>{A87A00B1-E6DB-45AB-8B54-636FEC3B5523}</news>
    <event>{52BDB3C4-0585-437C-89AD-6AAC81950633}</event>
</include>

有关更多详细信息,请参阅Sitecore 搜索和索引pdf。

然后您应该重建索引(您可以从Sitecore Desktop > Control Panel > Database > Rebuild the Search index执行此操作。重建索引完成后尝试确认索引中有任何项目。您可以使用 Sitecore 索引查看器模块或独立Luke-Lucene 索引工具箱

在这里,您可以找到有关解决 Sitecore 和 Lucene 问题的更多信息。

于 2013-05-20T07:46:22.113 回答