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 实现去掉重复的搜索结果的更多相关文章

  1. Apache solr(一)

    概念:Apache Solr 是一个开源的搜索服务器.Solr 使用 Java 语言开发,主要基于 HTTP 和 Apache Lucene 实现.Apache Solr 中存储的资源是以 Docum ...

  2. Apache Solr < 8.2.0远程命令执行漏洞(CVE-2019-0193)

    介绍:Apache Solr 是一个开源的搜索服务器.Solr 使用 Java 语言开发,主要基于 HTTP 和 Apache Lucene 实现. 漏洞原因:此次漏洞出现在Apache Solr的D ...

  3. Apache Solr应用服务器存在远程代码执行漏洞👻

    Apache Solr应用服务器存在远程代码执行漏洞 1.描述 Apache Solr是一个开源的搜索服务,使用Java语言开发,主要基于HTTP和Apache Lucene实现的. Solr是一个高 ...

  4. Apache Solr采用Java开发、基于Lucene的全文搜索服务器

    http://docs.spring.io/spring-data/solr/ 首先介绍一下solr: Apache Solr (读音: SOLer) 是一个开源.高性能.采用Java开发.基于Luc ...

  5. 使用 PHP 和 Apache Solr 实现企业搜索

    原文链接:http://www.ibm.com/developerworks/cn/opensource/os-php-apachesolr/   http://blog.csdn.net/hzcyc ...

  6. Apache solr 6.6.0安装

    Apache solr 6.6.0安装 最近使用了Apache solr搜索引擎框架,solr是基于lucene的一个搜索服务器,lucene也是Apache的一个开源项目:对于学习搜索引擎来说,这个 ...

  7. solrj:org.apache.solr.common.util.NamedList.java

    package org.apache.solr.common.util; import java.io.Serializable; import java.util.ArrayList; import ...

  8. Apache Solr 初级教程(介绍、安装部署、Java接口、中文分词)

    Python爬虫视频教程零基础小白到scrapy爬虫高手-轻松入门 https://item.taobao.com/item.htm?spm=a1z38n.10677092.0.0.482434a6E ...

  9. 05 Apache Solr: 管理员界面(Admin UI)

         为了方便管理员和工程师调整Solr的配置和访问在线文档和其他的帮助,Solr提供了一个Web界面去查看Solr的配置详情,运行查询语句和分析文档字段.这个界面在第三篇里面提到过就是管理员界面 ...

随机推荐

  1. mpi

    使用MPI,计算cos x 函数的积分值,积分区间为(0,2PI)这里写图片描述基本思路: 把积分区间,分为相等若干块(此处起多少个线程,分多少块),每个线程分得一块积分区域,每块在分若干小块(此处定 ...

  2. TensorFlow学习笔记1

    1.daocloud 拉取 docker镜像 docker pull daocloud.io/daocloud/tensorflow:latest 镜像位置: /Users/{YourUserName ...

  3. MFC对话框和属性表

    对话框主要有两类,分为模式和无模式,它们的功能都被封装在了CDialog中.与对话框相近的是属性表,属性表实际上是具有制表页(TAB 页)的对话框,将对话框中控件更好的组织在一起.借助Cpropert ...

  4. shiro与项目集成开发

    shiro与spring web项目开发 加入shiro的jar包 自定义realm /** * 自定义realm 继承授权realm * @author Administrator * */ pub ...

  5. Redis-08.命令参数详解

    1. redis-cli -r(repeat)选项代表江命令执行多次 # 执行3次ping命令 redis-cli -r 3 ping -i(interval)选项代表每个几秒执行一次命令(必须和-r ...

  6. 【腾讯Bugly干货分享】经典随机Crash之一:线程安全

    本文作者:鲁可--腾讯SNG专项测试组 测试工程师 背景 Android QQ 在2016下半年连着好几个版本二灰 Crash 率都很高,如果说有新需求,一灰的 Crash 率高,还能找点理由,可是开 ...

  7. 基于TensorFlow的深度学习系列教程 1——Hello World!

    最近看到一份不错的深度学习资源--Stanford中的CS20SI:<TensorFlow for Deep Learning Research>,正好跟着学习一下TensorFlow的基 ...

  8. LabVIEW(九):程序结构中的分支结构和顺序结构

    一.分支结构 1.创建分支结构:程序框图右键>结构>条件结构 2.Ctrl + I 会显示错误列表,双击错误列表会定位到该错误在程序框图中地方. 3.有的分支可以不连接分支内容. 在不连接 ...

  9. 程序员IT计算机中常见英语单词

    abstract 抽象的 abstract base class (ABC)抽象基类 abstract class 抽象类 abstraction 抽象.抽象物.抽象性 access 存取.访问 ac ...

  10. 过了所有技术面,却倒在 HR 一个问题上。。

    面试问离职原因,这是我们广大程序员朋友面试时逃不开的问题,如果答得不好,可能就影响了你整个的面试结果. 最近在栈长的Java技术栈vip群里,我也看到大家在讨论这个问题,其中有个朋友的回复栈长很有感触 ...