ParentsChildrenBlockJoinQuery (Lucene 10.5.0 join API)
Description: declaration: package: org.apache.lucene.search.join, class: ParentsChildrenBlockJoinQuery

Package org.apache.lucene.search.join

# Class ParentsChildrenBlockJoinQuery

java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.join.ParentsChildrenBlockJoinQuery

public class ParentsChildrenBlockJoinQuery extends Query
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

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_CHILD_LIMIT_PER_PARENT`
  The default maximum number of child documents to match per parent document.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ParentsChildrenBlockJoinQuery(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 Type
  Method
  Description
  `Weight`
  `createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)`
  `boolean`
  `equals(Object other)`
  `Query`
  `getChildQuery()`
  Return the child query.
  `Query`
  `getParentQuery()`
  Return the parent query.
  `int`
  `hashCode()`
  `Query`
  `rewrite(IndexSearcher indexSearcher)`
  `String`
  `toString(String field)`
  `void`
  `visit(QueryVisitor visitor)`

  ### Methods inherited from class org.apache.lucene.search.Query

  `classHash, sameClassAs, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### DEFAULT_CHILD_LIMIT_PER_PARENT

    public static final int DEFAULT_CHILD_LIMIT_PER_PARENT
    The default maximum number of child documents to match per parent document.
    See Also:
      - Constant Field Values

- ## 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

    public void visit(QueryVisitor visitor)
    Specified by:
      `visit` in class `Query`

  - ### createWeight

    public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException
    Overrides:
      `createWeight` in class `Query`
    Throws:
      `IOException`

  - ### getParentQuery

    public Query getParentQuery()
    Return the parent query.

  - ### getChildQuery

    public Query getChildQuery()
    Return the child query.

  - ### rewrite

    public Query rewrite(IndexSearcher indexSearcher) throws IOException
    Overrides:
      `rewrite` in class `Query`
    Throws:
      `IOException`

  - ### toString

    public String toString(String field)
    Specified by:
      `toString` in class `Query`

  - ### equals

    public boolean equals(Object other)
    Specified by:
      `equals` in class `Query`

  - ### hashCode

    public int hashCode()
    Specified by:
      `hashCode` in class `Query`