Using routing

Routing is the ability to point queries and index it to a single shard of the collection. Let's assume that we have a single collection and store data of hundreds of clients in that collection. We can have a single collection per customer, but there are just too many of them, so such a solution is not scalable at all. Instead we go with one collection and we keep the data of a single customer in a single shard, so when querying we don't have to query all the shards. This allows you to save resources when querying. This recipe will show you how to do it.

Getting ready

Before reading further, I advise you to read the Creating a new SolrCloud cluster recipe of this chapter. This recipe will show you how to create a new SolrCloud cluster ...

Get Solr Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.