Calculating faceting for relevant documents in groups

If you have ever used the field-collapsing functionality of Solr, you might be wondering whether there is a possibility of using that functionality and faceting. Of course, there is, but the default behavior still works and so you get the faceting calculation on the basis of documents and not on document groups. In this recipe, we will learn how to query Solr so that it returns facets calculated for the most relevant document in each group.

Getting ready

Before reading the following recipe, let's take a look at Grouping documents by the field value, Grouping documents by the query value, and Grouping documents by the function value recipes in Chapter 8, Using Additional Functionalities. Also ...

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.