Time for action – playing with sharding (distributed search)
Before talking about the implications of using shards, let's test this approach with two very simple example queries as follows:
- First of all, let's try to simulate a distributed search over a single Solr instance, using the same Solr core twice (if you would like to give a name to the idea, we can name this an
identity shard); in this case, we are executing the query on the
arts_paintingscore, and expanding the query with a distributed search over two simulated shards, which actually refers to the same core:
>> curl -X GET 'http://localhost:8983/solr/arts_paintings/select?shards=localhost:8983/solr/arts_paintings,localhost:8983/solr/arts_paintings&q=*:*&wt=json&debugQuery=on&fl=[shard],*' ...