mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-20 03:45:02 +00:00
use deletion aware constant score query
This commit is contained in:
parent
668e84a99e
commit
5205a183e8
@ -212,8 +212,8 @@ public class DeletionAwareConstantScoreQuery extends Query {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
if (!(o instanceof ConstantScoreQuery)) return false;
|
if (!(o instanceof DeletionAwareConstantScoreQuery)) return false;
|
||||||
ConstantScoreQuery other = (ConstantScoreQuery) o;
|
DeletionAwareConstantScoreQuery other = (DeletionAwareConstantScoreQuery) o;
|
||||||
return this.getBoost() == other.getBoost() && filter.equals(other.filter);
|
return this.getBoost() == other.getBoost() && filter.equals(other.filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,8 @@ public class CustomFieldQuery extends FieldQuery {
|
|||||||
}
|
}
|
||||||
} else if (sourceQuery instanceof ConstantScoreQuery) {
|
} else if (sourceQuery instanceof ConstantScoreQuery) {
|
||||||
flatten(((ConstantScoreQuery) sourceQuery).getFilter(), flatQueries);
|
flatten(((ConstantScoreQuery) sourceQuery).getFilter(), flatQueries);
|
||||||
|
} else if (sourceQuery instanceof DeletionAwareConstantScoreQuery) {
|
||||||
|
flatten(((DeletionAwareConstantScoreQuery) sourceQuery).getFilter(), flatQueries);
|
||||||
} else if (sourceQuery instanceof CustomBoostFactorQuery) {
|
} else if (sourceQuery instanceof CustomBoostFactorQuery) {
|
||||||
flatten(((CustomBoostFactorQuery) sourceQuery).getSubQuery(), flatQueries);
|
flatten(((CustomBoostFactorQuery) sourceQuery).getSubQuery(), flatQueries);
|
||||||
} else if (sourceQuery instanceof MultiTermQuery) {
|
} else if (sourceQuery instanceof MultiTermQuery) {
|
||||||
|
@ -61,7 +61,7 @@ public class FacetsPhase implements SearchPhase {
|
|||||||
|
|
||||||
// run global facets ...
|
// run global facets ...
|
||||||
if (context.searcher().globalCollectors() != null) {
|
if (context.searcher().globalCollectors() != null) {
|
||||||
Query query = new ConstantScoreQuery(context.filterCache().cache(Queries.MATCH_ALL_FILTER));
|
Query query = new DeletionAwareConstantScoreQuery(context.filterCache().cache(Queries.MATCH_ALL_FILTER));
|
||||||
if (context.types().length > 0) {
|
if (context.types().length > 0) {
|
||||||
if (context.types().length == 1) {
|
if (context.types().length == 1) {
|
||||||
String type = context.types()[0];
|
String type = context.types()[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user