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:

  1. 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_paintings core, 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],*' ...

Get Apache Solr Beginner's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.