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的配置详情,运行查询语句和分析文档字段.这个界面在第三篇里面提到过就是管理员界面 ...
随机推荐
- golang 快速排序及二分查找
二分查找 func main() { arr := []int{0, 1, 2, 3, 4, 5, 6} fmt.Println(BinarySearch(arr, 5)) } func Binary ...
- 基于继承的 MethodInterceptor 动态代理(换种写法)
net.sf.cglib.proxy.Enhancer Generates dynamic subclasses to enable method interception. This class s ...
- [swarthmore cs75] Compiler 2 – Boa
课程回顾 Swarthmore学院16年开的编译系统课,总共10次大作业.本随笔记录了相关的课堂笔记以及第4次大作业. A-Normal Form 在80年代,函数式语言编译器主要使用Continua ...
- 关于信息系统设计与开发——案例:VIP系统
一.关于信息系统设计与开发 信息系统开发流程先对需求分析系统分析,设计数据库,设计程序,再对测试数据进行测试. 在程序设计中运用了接口:定义一个接口,可以有多种实现.变量声明为接口变量,调用接口方法, ...
- 在windows上安装VTK
看了很多教程,花了1天半的时间装上了,记录下. 前置条件:我安装了VS2015,用来编译工程. 参考资料 官方:http://www.vtk.org/Wiki/VTK/Building 安装:http ...
- python网络爬虫开发实战(崔庆才)_14页_chromedriver环境配置和加载
自己1,环境配置,我下载了相对应的Chromedriver(其实我也不知道对不对应,都是下载最新版的我猜应该会对应),然后在任何文件夹下输入command+shift+G,打开输入窗口,任何输入 / ...
- Exp2 后门原理与实践-------20164325王晓蕊
Exp2 后门原理与实践 任务一:使用netcat获取主机操作Shell,cron启动 1.windows获取linux shell 1.1 ipconfig 查看本机查看以太网适配器(8)的ipv ...
- Spring Boot使用AOP实现REST接口简易灵活的安全认证
我们继续上一篇文章的分析,本文将通过AOP的方式实现一个相对更加简易灵活的API安全认证服务. 我们先看实现,然后介绍和分析AOP基本原理和常用术语. 一.Authorized实现 1.定义注解 pa ...
- 转载:Package by feature, not layer
原文地址:Package by feature, not layer Package by feature, not layer The first question in building an a ...
- 吴恩达机器学习笔记33-评估一个假设输出(Evaluating a Hypothesis Outpute)
当我们确定学习算法的参数的时候,我们考虑的是选择参量来使训练误差最小化,有人认为得到一个非常小的训练误差一定是一件好事,但我们已经知道,仅仅是因为这个假设具有很小的训练误差,并不能说明它就一定是一个好 ...