【发布时间】: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