Lowering the memory consumption of faceting and sorting

Faceting and sorting might require a large amount of RAM memory for large volumes of documents. For sorting or faceting, Solr needs to un-invert the values in the index and keep such information in memory—in the field cache. This might require a significant amount of memory when your data is large enough. Of course, you can scale out, have more nodes, and spread the collection among them so that a single Solr instance is put under less pressure. However, Lucene introduced a special structure called doc values, which can work as fast as field cache, but doesn't require as much memory. This recipe will show you how to use this.

How to do it...

For the purpose of this recipe, let's assume that ...

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.