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.
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.
There is no way to execute a single query across multiple cores. The Distributed Search mentioned in another answer is to do with shards which is splitting indexes across systems.
In fact, multiple cores are really for storing separate and different structures in each and querying multiple cores shouldn't make sense. As some have mentioned in previous comments, you can have an additional core which holds all your fields - though you may have to rename the fields in this new core so that similar named but differently typed fields can both be stored.
Mathew's answer is exactly right. Shards and multi-cores are apples and oranges. You cannot have a unified single query across multiple cores. You have to perform individual queries per core (http://localhost:8983/solr/core0/select?q=: ,http://localhost:8983/solr/core1/select?q=:). With shards however, (http://localhost:8983/solr/select?shards=localhost:8983/solr,localhost:8984/solr&q=:).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With