Nul*_*sis 3 lucene solr sitecore
我只是在Sitecore中设置我的Solr搜索功能,并将其编入索引.我可以搜索一下,然后收到结果.不幸的是,它索引TOO很多,并且正在返回系统特定的内容,例如内容树中的模板和分析节点.我输入像'system'这样的东西,它返回给我/ system /文件夹和其他地方的东西.
通过添加要排除的模板,我能够减少很多,但我宁愿告诉它要避免一两个特定的文件夹(布局文件夹,系统文件夹等).
有没有办法在ContentSearch配置中执行此操作?如果没有,我该怎么做?
谢谢!
您可以通过设置root节点来创建自定义索引并将其限制为您在该索引中所需的内容:
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="my_custom_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
...
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>web</Database>
<Root>/sitecore/content</Root>
</crawler>
</locations>
....
</index>
</indexes>
</configuration>
</contentSearch>
Run Code Online (Sandbox Code Playgroud)
请注意,index id属性设置为自定义索引名称,根节点更改为root节点.以上是副本Sitecore.ContentSearch.Solr.Index.Web.config,您可能需要master根据您的要求创建类似的副本.
您可以在此博文中找到有关定义自己的自定义索引的更多信息:在Sitecore 7中定义自定义索引,绝对最小值
或者,保留默认索引并向您自己的搜索查询添加过滤器,以/sitecore/content仅将返回的结果限制为仅限.
| 归档时间: |
|
| 查看次数: |
117 次 |
| 最近记录: |