mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-07 03:19:11 +00:00
optimize bool filter for single must clause or single should clause
This commit is contained in:
parent
06da379f50
commit
639a03fbe0
@ -70,6 +70,14 @@ public class XBooleanFilter extends Filter {
|
|||||||
public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
|
public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
|
||||||
FixedBitSet res = null;
|
FixedBitSet res = null;
|
||||||
|
|
||||||
|
if (mustFilters == null && notFilters == null && shouldFilters != null && shouldFilters.size() == 1) {
|
||||||
|
return shouldFilters.get(0).getDocIdSet(reader);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldFilters == null && notFilters == null && mustFilters != null && mustFilters.size() == 1) {
|
||||||
|
return mustFilters.get(0).getDocIdSet(reader);
|
||||||
|
}
|
||||||
|
|
||||||
if (shouldFilters != null) {
|
if (shouldFilters != null) {
|
||||||
for (int i = 0; i < shouldFilters.size(); i++) {
|
for (int i = 0; i < shouldFilters.size(); i++) {
|
||||||
final DocIdSet disi = getDISI(shouldFilters, i, reader);
|
final DocIdSet disi = getDISI(shouldFilters, i, reader);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user