Search across multiple cores and get unified resul

2019-08-10 10:34发布

问题:

I have 2 cores on a single solr instance. Schema's of both cores share same primary key. I want to merge results of a query from both the cores. Is it possible using solr?

I followed Solr:Distributed Search however the example didnt work for me ( I did get result but it was not unified) . I queried solr cores using :

localhost:8983/solr/core1/select/?shards=localhost:8983/solr/core1,localhost:8983/solr/core0&q=123_456.

Has anyone tried this approach before?

回答1:

What do you mean by Unified results ??
You should be able to get a combined results from both the Cores in a single result set.
However, there are few limitations.
The schema needs to same for both the cores or has been synced up so that the search happens on the same fields and are returned accordingly.

What do mean cores share same primary key ?
The Id needs to be unique across cores.

The unique key field must be unique across all shards. If docs with duplicate unique keys are encountered, Solr will make an attempt to return valid results, but the behavior may be non-deterministic.



标签: solr