Field Collapsing
This referes to functionality from
SOLR-236]
This patch is not complete, but it will be useful to keep this page updated while the interface evolves.
From
fast search]
"Used in order to collapse a group of results with similar value for a given field to a single entry in the result set. Site collapsing is a special case of this, where all results for a given web site is collapsed into one or two entries in the result set, typically with an associated "more documents from this site" link. See also Duplicate detection."
This topic was discussed a while ago:
http://www.nabble.com/result-grouping--tf2910425.html#a8131895
Parameters
|
param |
description |
|
collapse.type |
normal/adjacent -- does this collapse all fields or just the ones that are next to each other |
|
collapse.field |
Which field to collapse |
|
collapse.max |
How many results to show for the collapsed field. |
Examples
Using the example data:
Collapse all documents using 'cat' and 'normal' collapse type:
http://localhost:8983/solr/select/?q=*:*&collapse.field=cat&collapse.max=1&collapse.type=normal
<lst name="collapse_counts"> <int name="hard">1</int> <int name="electronics">2</int> <int name="memory">2</int> <int name="monitor">1</int> <int name="software">1</int> </lst>
http://localhost:8983/solr/select/?q=*:*&collapse.field=cat&collapse.max=1&collapse.type=adjacent
<lst name="collapse_counts"> <int name="hard">1</int> <int name="electronics">1</int> <int name="memory">2</int> <int name="monitor">1</int> </lst>