Apache Solr 实现去掉重复的搜索结果
https://lucene.apache.org/solr/guide/7_2/collapse-and-expand-results.html#collapsing-query-parser
对应的源码实现QParserPlugin
static {
HashMap<String, Class<? extends QParserPlugin>> map = new HashMap<>(30, 1);
map.put(LuceneQParserPlugin.NAME, LuceneQParserPlugin.class);
map.put(FunctionQParserPlugin.NAME, FunctionQParserPlugin.class);
map.put(PrefixQParserPlugin.NAME, PrefixQParserPlugin.class);
map.put(BoostQParserPlugin.NAME, BoostQParserPlugin.class);
map.put(DisMaxQParserPlugin.NAME, DisMaxQParserPlugin.class);
map.put(ExtendedDismaxQParserPlugin.NAME, ExtendedDismaxQParserPlugin.class);
map.put(FieldQParserPlugin.NAME, FieldQParserPlugin.class);
map.put(RawQParserPlugin.NAME, RawQParserPlugin.class);
map.put(TermQParserPlugin.NAME, TermQParserPlugin.class);
map.put(TermsQParserPlugin.NAME, TermsQParserPlugin.class);
map.put(NestedQParserPlugin.NAME, NestedQParserPlugin.class);
map.put(FunctionRangeQParserPlugin.NAME, FunctionRangeQParserPlugin.class);
map.put(SpatialFilterQParserPlugin.NAME, SpatialFilterQParserPlugin.class);
map.put(SpatialBoxQParserPlugin.NAME, SpatialBoxQParserPlugin.class);
map.put(JoinQParserPlugin.NAME, JoinQParserPlugin.class);
map.put(SurroundQParserPlugin.NAME, SurroundQParserPlugin.class);
map.put(SwitchQParserPlugin.NAME, SwitchQParserPlugin.class);
map.put(MaxScoreQParserPlugin.NAME, MaxScoreQParserPlugin.class);
map.put(BlockJoinParentQParserPlugin.NAME, BlockJoinParentQParserPlugin.class);
map.put(BlockJoinChildQParserPlugin.NAME, BlockJoinChildQParserPlugin.class);
map.put(CollapsingQParserPlugin.NAME, CollapsingQParserPlugin.class);
map.put(SimpleQParserPlugin.NAME, SimpleQParserPlugin.class);
map.put(ComplexPhraseQParserPlugin.NAME, ComplexPhraseQParserPlugin.class);
map.put(ReRankQParserPlugin.NAME, ReRankQParserPlugin.class);
map.put(ExportQParserPlugin.NAME, ExportQParserPlugin.class);
map.put(MLTQParserPlugin.NAME, MLTQParserPlugin.class);
map.put(HashQParserPlugin.NAME, HashQParserPlugin.class);
map.put(GraphQParserPlugin.NAME, GraphQParserPlugin.class);
map.put(XmlQParserPlugin.NAME, XmlQParserPlugin.class);
map.put(GraphTermsQParserPlugin.NAME, GraphTermsQParserPlugin.class);
map.put(IGainTermsQParserPlugin.NAME, IGainTermsQParserPlugin.class);
map.put(TextLogisticRegressionQParserPlugin.NAME, TextLogisticRegressionQParserPlugin.class);
map.put(SignificantTermsQParserPlugin.NAME, SignificantTermsQParserPlugin.class);
map.put(PayloadScoreQParserPlugin.NAME, PayloadScoreQParserPlugin.class);
map.put(PayloadCheckQParserPlugin.NAME, PayloadCheckQParserPlugin.class);
map.put(BoolQParserPlugin.NAME, BoolQParserPlugin.class);
standardPlugins = Collections.unmodifiableMap(map);
}
具体如下:
/** The <b>CollapsingQParserPlugin</b> is a PostFilter that performs field collapsing.
This is a high performance alternative to standard Solr
field collapsing (with ngroups) when the number of distinct groups
in the result set is high.
<p>
Sample syntax:
<p>
Collapse based on the highest scoring document:
<p> fq=(!collapse field=field_name} <p>
Collapse based on the min value of a numeric field:
<p>
fq={!collapse field=field_name min=field_name}
<p>
Collapse based on the max value of a numeric field:
<p>
fq={!collapse field=field_name max=field_name}
<p>
Collapse with a null policy:
<p>
fq={!collapse field=field_name nullPolicy=nullPolicy}
<p>
There are three null policies: <br>
ignore : removes docs with a null value in the collapse field (default).<br>
expand : treats each doc with a null value in the collapse field as a separate group.<br>
collapse : collapses all docs with a null value into a single group using either highest score, or min/max.
<p>
The CollapsingQParserPlugin fully supports the QueryElevationComponent
**/
Apache Solr 实现去掉重复的搜索结果的更多相关文章
- Apache solr(一)
概念:Apache Solr 是一个开源的搜索服务器.Solr 使用 Java 语言开发,主要基于 HTTP 和 Apache Lucene 实现.Apache Solr 中存储的资源是以 Docum ...
- Apache Solr < 8.2.0远程命令执行漏洞(CVE-2019-0193)
介绍:Apache Solr 是一个开源的搜索服务器.Solr 使用 Java 语言开发,主要基于 HTTP 和 Apache Lucene 实现. 漏洞原因:此次漏洞出现在Apache Solr的D ...
- Apache Solr应用服务器存在远程代码执行漏洞👻
Apache Solr应用服务器存在远程代码执行漏洞 1.描述 Apache Solr是一个开源的搜索服务,使用Java语言开发,主要基于HTTP和Apache Lucene实现的. Solr是一个高 ...
- Apache Solr采用Java开发、基于Lucene的全文搜索服务器
http://docs.spring.io/spring-data/solr/ 首先介绍一下solr: Apache Solr (读音: SOLer) 是一个开源.高性能.采用Java开发.基于Luc ...
- 使用 PHP 和 Apache Solr 实现企业搜索
原文链接:http://www.ibm.com/developerworks/cn/opensource/os-php-apachesolr/ http://blog.csdn.net/hzcyc ...
- Apache solr 6.6.0安装
Apache solr 6.6.0安装 最近使用了Apache solr搜索引擎框架,solr是基于lucene的一个搜索服务器,lucene也是Apache的一个开源项目:对于学习搜索引擎来说,这个 ...
- solrj:org.apache.solr.common.util.NamedList.java
package org.apache.solr.common.util; import java.io.Serializable; import java.util.ArrayList; import ...
- Apache Solr 初级教程(介绍、安装部署、Java接口、中文分词)
Python爬虫视频教程零基础小白到scrapy爬虫高手-轻松入门 https://item.taobao.com/item.htm?spm=a1z38n.10677092.0.0.482434a6E ...
- 05 Apache Solr: 管理员界面(Admin UI)
为了方便管理员和工程师调整Solr的配置和访问在线文档和其他的帮助,Solr提供了一个Web界面去查看Solr的配置详情,运行查询语句和分析文档字段.这个界面在第三篇里面提到过就是管理员界面 ...
随机推荐
- Monkey压力测试操作步骤说明
一.需配置java环境和android环境 JDK安装包:链接:https://pan.baidu.com/s/1SlnBOS0f3m2wVpEZBPfmag ...
- vue中的axios封装
import axios from 'axios'; import { Message } from 'element-ui'; axios.defaults.timeout = 5000;axios ...
- oracle 恢复table删除数据 恢复package(使用闪回)
好久没写东西了,今天写一篇凑个数吧,来公司一年多了,感觉自己到了一个小瓶颈期了. 以前每天很多新东西,都是忙着学,感觉没时间写博客总结一下,大部分都是写笔记,现在又是没东西可以写,每天干着95%都是重 ...
- redis_简单动态字符串
在redis中,C字符串(以'\0'结尾的字符数组)只用在一些无需对字符串值进行修改的地方,比如打印日志.其他情况,redis使用SDS - SimpleDynamicString 简单动态字符串,来 ...
- 怎样用git上传代码到github以及如何更新代码
上传代码: 1.进入指定文件夹: cd 指定文件夹 2.初始化git仓库: git init 3.将项目所有文件添加到暂存区: git add . 4.提交到仓库: git commit -m &qu ...
- ArcSDE
ArcSDE,即数据通路,是ArcGIS的空间数据引擎,它是在关系数据库管理系统(RDBMS)中存储和管理多用户空间数据库的通路.从空间数据管理的角度看,ArcSDE是一个连续的空间数据模型,借助这一 ...
- Python基础-数据类型-转摘
1.数字 2 是一个整数的例子.长整数 不过是大一些的整数.3.23和52.3E-4是浮点数的例子.E标记表示10的幂.在这里,52.3E-4表示52.3 * 10-4.(-5+4j)和(2.3-4. ...
- Gitee(码云)、Github同时配置ssh key
一.cd ~/.ssh 二.通过下面的命令,依次生成两个平台的key $ ssh-keygen -t rsa -C "xxxxxxx@qq.com" -f "github ...
- uc/osⅡ/Ⅲ
1.关于任务堆栈时#if在main()中的用法: #if ... #else#endif//与#if对应作为一个编译“开关”,比如#if(条件满足) 执行代码1 #else 执行代码2 #endif ...
- 一篇入门 — Scala 宏
前情回顾 上一节, 我简单的说了一下反射的基本概念以及运行时反射的用法, 同时简单的介绍了一下编译原理知识, 其中我感觉最为绕的地方, 就属泛型的几种使用方式了. 而最抽象的概念, 就是对于符号和抽象 ...