tags:

views:

777

answers:

1

Hi

We have several core's setup in SOLR and would like to search across these cores and return a single result set.

A bit more background: We have a SOLR core that we index our internal blog engine. We also have a SOLR core that we index our CMS system. We would like to search across both of these cores but view a single result set.

I am aware of having related entities in a document, but we would like to keep the cores separate, for easy of maintenance, and redundancy.

We are using SolrSharp as a wrapper for searching SOLR. Any advice or direction would be appreciated.

+2  A: 

Since Solr 1.3, there's been decent multi-core search capabilities in Solr. Please read the Distributed Search article where it explains how to use the shards parameter to query across multiple cores and return results as one data set.

Brian Mansell
Does the DistributedSearch work though across multiple different cores? Haven't tried it myself, but I wonder if it would be unhappy if core A has fields "name" and "title" and core B has fields "name" and "summary", and therefore they don't match? Or would you get back name, summary, and title as appropriate?
Eric Pugh
Eric - My strategy is to employ a separate core with a merged schema that has a request handler implemented to search multiple shards. That way the client doesn't need to worry about providing the "shards" parameter.
Brian Mansell
So if I have Core0 with fields documentId,fieldA,fieldB and Core1 with fields documentId,fieldC,fieldD. Then I create another core, lets say Core3 with fields documentId,fieldA,fieldB,fieldC,fieldD. I will never be importing data into this core? And then create a query handler, that includes the shard parameter. So when I query Core3, it will never really contain indexed data, but because of the shard searching it will fetch the results from the other to cores, and "present" it on the 3rd core? Thanks for the help!
Rihan Meij
Rihan -That's spot on what I'm recommending.
Brian Mansell
Thanks Brian it worked brilliantly!
Rihan Meij