O'Reilly logo

Apache Solr Enterprise Search Server - Third Edition by Matt Mitchell, Kranti Parisa, Eric Pugh, David Smiley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Collapsing and expanding

The collapse query parser and expand search component are two related features that arrived in Solr 4.7 as an alternative to Solr's Result Grouping feature (group=true). First, we'll describe these two features and then compare it to result grouping.

The Collapse query parser

The collapse query parser filters search results so that only one document is returned out of all of those for a given field's value. Said differently, it collapses search results to one document per group of those with the same field value. This query parser is a special type called post-filter, which can only be used as a filter query because it needs to see the results of all other filter queries and the main query. In order to pick which document ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required