public ESToParentBlockJoinQuery(Query childQuery, BitSetProducer parentsFilter, ScoreMode scoreMode, String path) { this(new ToParentBlockJoinQuery(childQuery, parentsFilter, scoreMode), path); }
/** Return the child query. */ public Query getChildQuery() { return query.getChildQuery(); }
@Override public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException { return query.createWeight(searcher, needsScores, boost); }
@Override public Query rewrite(IndexReader reader) throws IOException { if (getBoost() != 1f) { return super.rewrite(reader); } final Query childRewrite = childQuery.rewrite(reader); if (childRewrite != childQuery) { return new ToParentBlockJoinQuery(origChildQuery, childRewrite, parentsFilter, scoreMode); } else { return super.rewrite(reader); } }
@Override public boolean equals(Object obj) { if (sameClassAs(obj) == false) { return false; } ESToParentBlockJoinQuery that = (ESToParentBlockJoinQuery) obj; return query.equals(that.query) && Objects.equals(path, that.path); }
@Override public String toString(String field) { return query.toString(field); }
@Override public Query rewrite(IndexReader reader) throws IOException { Query innerRewrite = query.rewrite(reader); if (innerRewrite != query) { // Right now ToParentBlockJoinQuery always rewrites to a ToParentBlockJoinQuery // so the else block will never be used. It is useful in the case that // ToParentBlockJoinQuery one day starts to rewrite to a different query, eg. // a MatchNoDocsQuery if it realizes that it cannot match any docs and rewrites // to a MatchNoDocsQuery. In that case it would be fine to lose information // about the nested path. if (innerRewrite instanceof ToParentBlockJoinQuery) { return new ESToParentBlockJoinQuery((ToParentBlockJoinQuery) innerRewrite, path); } else { return innerRewrite; } } return super.rewrite(reader); }
@Override public boolean equals(Object obj) { if (sameClassAs(obj) == false) { return false; } ESToParentBlockJoinQuery that = (ESToParentBlockJoinQuery) obj; return query.equals(that.query) && Objects.equals(path, that.path); }
@Override public String toString(String field) { return query.toString(field); }
@Override public Query rewrite(IndexReader reader) throws IOException { Query innerRewrite = query.rewrite(reader); if (innerRewrite != query) { // Right now ToParentBlockJoinQuery always rewrites to a ToParentBlockJoinQuery // so the else block will never be used. It is useful in the case that // ToParentBlockJoinQuery one day starts to rewrite to a different query, eg. // a MatchNoDocsQuery if it realizes that it cannot match any docs and rewrites // to a MatchNoDocsQuery. In that case it would be fine to lose information // about the nested path. if (innerRewrite instanceof ToParentBlockJoinQuery) { return new ESToParentBlockJoinQuery((ToParentBlockJoinQuery) innerRewrite, path); } else { return innerRewrite; } } return super.rewrite(reader); }
public ESToParentBlockJoinQuery(Query childQuery, BitSetProducer parentsFilter, ScoreMode scoreMode, String path) { this(new ToParentBlockJoinQuery(childQuery, parentsFilter, scoreMode), path); }
/** Return the child query. */ public Query getChildQuery() { return query.getChildQuery(); }
@Override public boolean equals(Object obj) { if (sameClassAs(obj) == false) { return false; } ESToParentBlockJoinQuery that = (ESToParentBlockJoinQuery) obj; return query.equals(that.query) && Objects.equals(path, that.path); }
@Override public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException { return query.createWeight(searcher, needsScores, boost); }
@Override public String toString(String field) { return query.toString(field); }
@Override public Query rewrite(IndexReader reader) throws IOException { Query innerRewrite = query.rewrite(reader); if (innerRewrite != query) { // Right now ToParentBlockJoinQuery always rewrites to a ToParentBlockJoinQuery // so the else block will never be used. It is useful in the case that // ToParentBlockJoinQuery one day starts to rewrite to a different query, eg. // a MatchNoDocsQuery if it realizes that it cannot match any docs and rewrites // to a MatchNoDocsQuery. In that case it would be fine to lose information // about the nested path. if (innerRewrite instanceof ToParentBlockJoinQuery) { return new ESToParentBlockJoinQuery((ToParentBlockJoinQuery) innerRewrite, path); } else { return innerRewrite; } } return super.rewrite(reader); }
public ESToParentBlockJoinQuery(Query childQuery, BitSetProducer parentsFilter, ScoreMode scoreMode, String path) { this(new ToParentBlockJoinQuery(childQuery, parentsFilter, scoreMode), path); }
/** Return the child query. */ public Query getChildQuery() { return query.getChildQuery(); }
@Override public boolean equals(Object obj) { if (sameClassAs(obj) == false) { return false; } ESToParentBlockJoinQuery that = (ESToParentBlockJoinQuery) obj; return query.equals(that.query) && Objects.equals(path, that.path); }
@Override public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException { return query.createWeight(searcher, needsScores); }