简体   繁体   English

Sitecore多站点Lucene搜索的相关性

[英]Sitecore Multisite Lucene Search Relevance

I currently have a multisite setup of Sitecore 6.4. 我目前有一个Sitesite 6.4的多站点设置。 I had installed the LuceneSearch module on the sites but have been requested to display results for the search across all sites. 我已经在站点上安装了LuceneSearch模块,但已被要求显示所有站点上的搜索结果。 I have altered the 'Root' in the index definition on the web.config to point to the root containing all sites and this successfully returns results across all sites. 我已经更改了web.config上索引定义中的“根”,以指向包含所有站点的根,这将成功返回所有站点的结果。

However, these results need to be weighted to display the current context site's results above the others. 但是,需要对这些结果进行加权,以将当前上下文站点的结果显示在其他结果之上。

Is there any easy way to achieve this? 有没有简单的方法可以做到这一点?

I have been toying with the idea of creating a separate index for each site and then looping through all the sites returning the results from the current site's index first but I suspect there must be a better idea. 我一直在想为每个站点创建一个单独的索引,然后循环遍历所有站点,首先返回当前站点索引的结果,但是我怀疑一定有更好的主意。

As far as I know the boost values are set when you create or re-build an index so you won't be able to set a boost value based on a context site. 据我所知,在创建或重建索引时会设置提升值,因此您将无法基于上下文站点设置提升值。

Just a thought but using the AdvancedDatabaseCrawler SharedSource module you could add a new dynamic field called 'site' and store the site id or site name for each item you are indexing. 只是想一想,但是使用AdvancedDatabaseCrawler SharedSource模块,您可以添加一个名为“ site”的新动态字段,并为要索引的每个项目存储站点ID或站点名称。 You could then search the index twice. 然后,您可以搜索索引两次。 Once to get all the results for the current context site and then a second search where you get all the results where the site field does not equal the context site. 一次获取当前上下文站点的所有结果,然后第二次搜索,在其中站点字段不等于上下文站点的情况下获取所有结果。

you can index the path of each item and add it as lucene field, then make a prefix query with the start path of each site. 您可以索引每个项目的路径并将其添加为lucene字段,然后使用每个站点的起始路径进行前缀查询。

NOTE: when you index the path, replace ("/" or space ) with something else, like '#', and do the same when you build the query. 注意:当您为路径建立索引时,请用其他东西(例如“#”)替换(“ /”或space),并在构建查询时执行相同的操作。

for advance use of lucene search, look to : http://sitecoreblog.alexshyba.com/2010/11/sitecore-searcher-and-advanced-database.html 有关提前使用Lucene搜索的信息,请访问: http : //sitecoreblog.alexshyba.com/2010/11/sitecore-searcher-and-advanced-database.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM