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