lucene索引查询



一、Lucene 索引知识扩展


二、索引查询

Lucene 构建查询套路


常用 Query 查询类

TermQuery

BooleanQuery


分页查询


高亮显示


Facets 分类索引

多级分类(类似:省->市->县)

1
2
3
4
5
6
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-facet -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-facet</artifactId>
<version>${lucene.version}</version>
</dependency>

下钻查询

1
2
3
DrillDownQuery drillDownQuery = new DrillDownQuery(config, query);
drillDownQuery.add();
FacetsCollector facetsCollector = new FacetsConector();

查询平行维度

1
DrillSideways ds = new DrillSideways(searcher, config, query);