【问题标题】:Custom Lucene Index not visible in Sitecore's Indexing Manager自定义 Lucene 索引在 Sitecore 的索引管理器中不可见
【发布时间】:2016-02-25 13:16:40
【问题描述】:

我的任务是在基于 Sitecore(7.2 版)的网站中实施内容搜索。同样,我计划使用 Lucene 搜索提供程序,因为它与 Sitecore 捆绑在一起,开箱即用,而且我们的搜索要求似乎并不太详尽,我无法尝试使用 Solr。 我们希望用户能够从主站点搜索驻留在 Sitecore 中的可存储内容列表。 解释如何执行此操作的文档和博客是粗略且不完整的。

我以以下博客为参考点:

http://www.mattburkedev.com/sitecore-7-contentsearch-tips/

在 App_Config/Include 文件夹中添加索引配置文件后,我希望在 Sitecore 的索引管理器中看到新索引。但是我在那里没有注意到同样的情况。关于我做错了什么有什么想法吗?

我想创建一个自定义索引,这样我就可以只定位特定的站点核心节点。请看我的配置文件。我只需要使用文章项目模板中设置的字段在文章节点中搜索数据。

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <contentSearch>
      <configuration type="Sitecore.ContentSearch.LuceneProvider.LuceneSearchConfiguration, Sitecore.ContentSearch.LuceneProvider">
        <indexes hint="list:AddIndex">
          <index id="book_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
            <param desc="name">$(id)</param>
            <param desc="folder">$(id)</param>
            <!-- This initializes index property store. Id has to be set to the index id -->
            <param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)" />
            <strategies hint="list:AddStrategy">
              <!-- NOTE: order of these is controls the execution order -->
              <strategy ref="contentSearch/indexUpdateStrategies/syncMaster" />
            </strategies>
            <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
              <policies hint="list:AddCommitPolicy">
                <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
              </policies>
            </commitPolicyExecutor>
            <locations hint="list:AddCrawler">
              <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>master</Database>
                <Root>/sitecore/content/support/articles</Root>
              </crawler>
            </locations>
          </index>
        </indexes>
      </configuration>
    </contentSearch>
  </sitecore>
</configuration> 

【问题讨论】:

  • 你能检查日志文件吗?我猜你的索引有一些错误。这就是为什么没有出现在索引管理器上的原因
  • mikkelhm.dk/archive/…你也可以看看这个
  • 为什么不直接使用 Sitecore 附带的搜索索引?这样您就不必实现单独的主索引和 Web 自定义索引。
  • @RichardSeal - 请查看我对该问题所做的更新。
  • @SitecoreClimber - 请查看我对该问题所做的更新。

标签: lucene sitecore sitecore7 sitecore7.2


【解决方案1】:

我终于能够在索引管理器中看到我的索引。配置文件的名称似乎有问题。我将我的索引文件命名为“Sitecore.ContentSearch.Lucene.Downloads.config”,然后出现了索引。该文件在标准 Lucene 配置之前被修补,因此出现了问题。

【讨论】:

    【解决方案2】:

    只需将您的配置文件重命名为 z.Sitecore.ContentSearch.Lucene.Downloads.config

    这是因为当 sitecore 将您的所有配置合并到一个文件中时,会考虑文件名。

    谢谢

    【讨论】:

      【解决方案3】:

      你的一些命名空间在你的配置中是关闭的。请尝试此配置,看看它是否为您显示。我已经修改它以匹配您的参数。这应该适合你。

      <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <sitecore>
          <contentSearch>
            <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
              <indexes hint="list:AddIndex">
                <index id="book_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
                  <param desc="name">$(id)</param>
                  <param desc="folder">$(id)</param>
                  <!-- This initializes index property store. Id has to be set to the index id -->
                  <param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)" />
                  <configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration" />
                  <strategies hint="list:AddStrategy">
                    <!-- NOTE: order of these is controls the execution order -->
                    <strategy ref="contentSearch/indexUpdateStrategies/syncMaster" />
                  </strategies>
                  <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
                    <policies hint="list:AddCommitPolicy">
                      <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
                    </policies>
                  </commitPolicyExecutor>
                  <locations hint="list:AddCrawler">
                    <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                      <Database>master</Database>
                      <Root>/sitecore/content/support/articles</Root>
                    </crawler>
                  </locations>
                </index>
              </indexes>
            </configuration>
          </contentSearch>
        </sitecore>
      </configuration>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-08-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-20
        相关资源
        最近更新 更多