Efficient documents grouping using the post filter
Sometimes, the standard field collapsing provided by Solr is not enough when it comes to performance. This is especially true when we want to perform field collapsing on fields that will result in large number of unique groups in the results, so mostly, for high cardinality fields. For such use cases, Solr provides an efficient post filter approach of field collapsing, and this recipe will show you how to use that approach.
Getting ready
In this chapter, we will use the same index structure and test data as we used in the Grouping documents by the field value recipe of this chapter. Read it before we continue.
How to do it...
- Let's start with the index structure. Let's assume that we have the following ...
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.