lucene布林查詢子句關係

2021-08-30 09:31:04 字數 435 閱讀 6642

occur用於表示布林查詢子句關係的類,包括:

occur.must, occur,must_not occur.should

1, must和must:取得連個查詢子句的交集

2,must和must_not :包含must並且查詢結果中不包含must_not的檢索結果

3,should和should 表示「或」關係, 最終檢索結果為所有檢索子句的並集

使用注意:

1 must和should:此時should無意義,結果為must子句的檢索結果

2 must_not和must_not :無意義,檢索無結果

3 must_not 和should:此時should相當於must,結果同must和must_not一樣

4 單獨使用should:結果相當於must

5 單獨使用must_not: 無意義,檢索無結果

Lucene查詢的函式呼叫關係

indexsearcher.search indexsearcher.createnormalizedweight query phrasequery.createweight new phraseweight indexsearcher.getsimilarity defaultsimilarit...

where子句查詢

使用where關鍵進行查詢結果篩選 select 欄位名,欄位名,from表名 where 篩選條件 單條件篩選 單篩選條件 使用運算子進行篩選 單個條件中 注意 如果條件中的值為字元,必須使用單引號括起來 查詢所有的員工的工資資訊 select empno,ename,sal comm as 薪資...

Lucene 搜尋方法(布林搜尋)

布林搜尋 布林查詢的物件中,包含乙個子句的集合。各種子句間都是 與 或 這樣的布林邏輯。package com.querytype import org.apache.lucene.index.term import org.apache.lucene.search.booleanclause im...