Package org.apache.lucene.search.join
Class ParentsChildrenBlockJoinQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.join.ParentsChildrenBlockJoinQuery
A query that returns the matching child documents for matching parent documents indexed together
in the same block. The provided parentQuery determines the parent documents of the returned
children documents. The provided childQuery determines which matching children documents are
being returned. childLimitPerParent is the maximum number of child documents to match per parent
document.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default maximum number of child documents to match per parent document. -
Constructor Summary
ConstructorsConstructorDescriptionParentsChildrenBlockJoinQuery(BitSetProducer parentFilter, Query parentQuery, Query childQuery) Create a ParentsChildrenBlockJoinQuery with DEFAULT_CHILD_LIMIT_PER_PARENT.ParentsChildrenBlockJoinQuery(BitSetProducer parentFilter, Query parentQuery, Query childQuery, int childLimitPerParent) Create a ParentsChildrenBlockJoinQuery.ParentsChildrenBlockJoinQuery(BitSetProducer parentFilter, Query parentQuery, Query childQuery, int childLimitPerParent, BinaryOperator<Float> scoreCombiner) Create a ParentsChildrenBlockJoinQuery with a custom score combiner. -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) booleanReturn the child query.Return the parent query.inthashCode()rewrite(IndexSearcher indexSearcher) voidvisit(QueryVisitor visitor) Methods inherited from class org.apache.lucene.search.Query
classHash, sameClassAs, toString
-
Field Details
-
DEFAULT_CHILD_LIMIT_PER_PARENT
public static final int DEFAULT_CHILD_LIMIT_PER_PARENTThe default maximum number of child documents to match per parent document.- See Also:
-
-
Constructor Details
-
ParentsChildrenBlockJoinQuery
public ParentsChildrenBlockJoinQuery(BitSetProducer parentFilter, Query parentQuery, Query childQuery, int childLimitPerParent) Create a ParentsChildrenBlockJoinQuery.- Parameters:
parentFilter- Filter identifying the parent documents.parentQuery- Query that matches parent documents.childQuery- Query that matches child documents.childLimitPerParent- The maximum number of child documents to match per parent.
-
ParentsChildrenBlockJoinQuery
public ParentsChildrenBlockJoinQuery(BitSetProducer parentFilter, Query parentQuery, Query childQuery, int childLimitPerParent, BinaryOperator<Float> scoreCombiner) Create a ParentsChildrenBlockJoinQuery with a custom score combiner.- Parameters:
parentFilter- Filter identifying the parent documents.parentQuery- Query that matches parent documents.childQuery- Query that matches child documents.childLimitPerParent- The maximum number of child documents to match per parent.scoreCombiner- Function to combine parent and child scores.
-
ParentsChildrenBlockJoinQuery
public ParentsChildrenBlockJoinQuery(BitSetProducer parentFilter, Query parentQuery, Query childQuery) Create a ParentsChildrenBlockJoinQuery with DEFAULT_CHILD_LIMIT_PER_PARENT.- Parameters:
parentFilter- Filter identifying the parent documents.parentQuery- Query that matches parent documents.childQuery- Query that matches child documents.
-
-
Method Details
-
visit
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException - Overrides:
createWeightin classQuery- Throws:
IOException
-
getParentQuery
Return the parent query. -
getChildQuery
Return the child query. -
rewrite
- Overrides:
rewritein classQuery- Throws:
IOException
-
toString
-
equals
-
hashCode
public int hashCode()
-