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
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ConstantScoreQuery)) return false;
|
||||
ConstantScoreQuery other = (ConstantScoreQuery) o;
|
||||
if (!(o instanceof DeletionAwareConstantScoreQuery)) return false;
|
||||
DeletionAwareConstantScoreQuery other = (DeletionAwareConstantScoreQuery) o;
|
||||
return this.getBoost() == other.getBoost() && filter.equals(other.filter);
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,8 @@ public class CustomFieldQuery extends FieldQuery {
|
|||
}
|
||||
} else if (sourceQuery instanceof ConstantScoreQuery) {
|
||||
flatten(((ConstantScoreQuery) sourceQuery).getFilter(), flatQueries);
|
||||
} else if (sourceQuery instanceof DeletionAwareConstantScoreQuery) {
|
||||
flatten(((DeletionAwareConstantScoreQuery) sourceQuery).getFilter(), flatQueries);
|
||||
} else if (sourceQuery instanceof CustomBoostFactorQuery) {
|
||||
flatten(((CustomBoostFactorQuery) sourceQuery).getSubQuery(), flatQueries);
|
||||
} else if (sourceQuery instanceof MultiTermQuery) {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class FacetsPhase implements SearchPhase {
|
|||
|
||||
// run global facets ...
|
||||
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 == 1) {
|
||||
String type = context.types()[0];
|
||||
|
|
Loading…
Reference in New Issue