Solr Result Grouping / Field Collapsing

Result Grouping, also called Field Collapsing, has been committed to Solr!
This functionality limits the number of documents for each “group”, usually defined by the unique values in a field (just like field faceting).

You can think of it like faceted search, except instead of just getting a count, you get the top documents for that constraint or category. There are tons of potential use cases:

  • For web search, only show 1 or 2 results for a given website by collapsing on a site field.
  • For email search, only show 1 or 2 results for a given email thread
  • For e-commerce, show the top 3 products for each store category (i.e. “electronics”, “housewares”)
  • Hiding duplicate documents at query time.

In addition to being able to group by the values of a field, you can also group by the values of a function query. Given that geo search works as a function query, this also opens up possibilities for showing top query matches within 1 mile, between 1 and 2 miles, etc.

Just like faceting, we’ll be adding new functionality and making continual improvements.
Result Grouping is documented on the Solr Wiki, and you will need a recent
nightly build of Solr 4.0-dev to try it out (just make sure it’s dated after this post).

Share the knowledge

You Might Also Like

Lucidworks AI Chunking: The Missing Foundation for Accurate Enterprise AI

Behind every AI-powered search, assistant, or generative experience sits a massive volume...

Read More

Beyond Keywords: Why AI Data Enrichment Is the Missing Link for AI‑Powered Commerce

Across B2B and B2C commerce, teams invest heavily in tuning ranking models,...

Read More

Why the World’s Best Enterprises Choose Lucidworks for Search, and Why It Matters Now

Search has quietly become one of the most strategic systems in the...

Read More

Quick Links