开发者

Sitecore Multisite Lucene Search Relevance

开发者 https://www.devze.com 2023-03-07 02:23 出处:网络
I currently have a multisite setup of Sitecore 6.4. I had installed the LuceneSearch module on the sites but have been requested to display results for the search across all sites. I have altered the

I currently have a multisite setup of Sitecore 6.4. I had installed the LuceneSearch module on the sites but have been requested to display results for the search across all sites. 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.

However, these results need to be weighted to dis开发者_Python百科play 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.


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.

NOTE: when you index the path, replace ("/" or space ) with something else, like '#', and do the same when you build the query.

for advance use of lucene search, look to : http://sitecoreblog.alexshyba.com/2010/11/sitecore-searcher-and-advanced-database.html


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. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号