Question

I have a single core Solr setup with millions of documents which I want to split into many smaller shards (on the same machine).
The motivation is to reduce the commit / "soft commit" time.
Then I plan to use the "Distributed Searching" for doing the same queries on all shards and getting the unified results (as if it was one core).
My queries include faceting but I believe it is supported for cross shards searches.
Can it be done without Solr Cloud?
I'm new with Solr and I'm not sure about the difference between Shards and Cores.
My main question is whether I can configure multiple cores on the same server and use them as shards?
If someone can point me to a relevant example / documentation for such setup it will be very helpful.

Was it helpful?

Solution 2

After doing some testing it seems to work just fine with cores.
I've created few cores and sent the query request with the shards parameter including the core name in the url.
Example:

http://localhost:8983/solr/core1/select?q=name%3Atest&wt=xml&indent=true&shards=localhost:8983/solr/core1,localhost:8983/solr/core2

OTHER TIPS

Or you can add a new requestHandler in the solr config for either of the cores as below

  <requestHandler name="/new-req" class="solr.SearchHandler">
    <lst name="defaults">
      <str name="shards">localhost:8983/solr/core1,localhost:8983/solr/core2</str>
    </lst>
  </requestHandler>

So the query URL will be shorter as below

http://localhost:8983/solr/core1/new-req?q=name%3Atest&wt=xml&indent=true
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top