문제

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.

도움이 되었습니까?

해결책 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

다른 팁

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top