陋室铭
永远也不要停下学习的脚步(大道至简至易)

posts - 2169,comments - 570,views - 413万

简介

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查询举例

查询语法:
http://localhost:8080/solr/JobsOtherWeb0/select?q=jobsName%3A%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%B4%E6%8A%A4&facet=true&facet.field=salary&facet.field=publishDate&facet.field=educateBackground&facet.field=jobExperience&facet.field=companytype&facet.field=jobsType&facet.limit=10&facet.missing=false&facet.mincount=1

查询结果是根据主查询条件得出的。facet是聚类后的信息,跟查询条件是分开的,查询结果跟facet没关系。

查询结果:

Group查询举例

查询语法:
http://localhost:8080/solr/JobsOtherWeb0/select?q=jobsName%3A%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%B4%E6%8A%A4&group=true&group.field=salary&group.limit=1&rows=10

查询条件跟group相关的,返回的查询结果跟group也是相关的,group中有相关文档的详细信息。

查询结果:
这里写图片描述

posted on   宏宇  阅读(710)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
历史上的今天:
2012-07-31 C# 禁用本地连接和修改IE设置
2008-07-31 页面动态注册脚本(小技巧)
2008-07-31 动态画table(小技巧)
2008-07-31 Import和Assembly
2008-07-31 Post和Get的区别(兼谈页面间传值的方式)(转)
2008-07-31 ASP.NET十分有用的页面间传值方法(转)
2007-07-31 SOA and Web services 新手入门
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示