简介
facet的查询结果主要是分组信息:有什么分组,每个分组包括多少记录;但是分组中有哪些数据是不可知道的,只有进一步搜索。
group则类似于关系数据库的group by,可以用于一个或者几个字段去重、显示一个group的前几条记录等。
来自solr ref guide的解释:
Result Grouping groups documents with a common field value into groups and returns the top documents for
each group.
Result Grouping is separate from Faceting. Though it is conceptually similar, faceting returns all relevant results
and allows the user to refine the results based on the facet category. For example, if you search for “shoes” on a
footwear retailer’s e-commerce site, Solr would return all results for that query term, along with selectable facets
such as “size,” “color,” “brand,” and so on.
Facet查询举例
查询语法: