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

Package org.apache.lucene.search.join

# Class ToParentBlockJoinSortField

java.lang.Object
org.apache.lucene.search.SortField
org.apache.lucene.search.join.ToParentBlockJoinSortField

public class ToParentBlockJoinSortField extends SortField
A special sort field that allows sorting parent docs based on nested / child level fields. Based on the sort order it either takes the document with the lowest or highest field value into account.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.lucene.search.SortField

  `SortField.Provider, SortField.Type`

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.search.SortField

  `FIELD_DOC, FIELD_SCORE, missingValue, reverse, STRING_FIRST, STRING_LAST`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverseParents, boolean reverseChildren, Object parentMissingValue, Object childMissingValue, BitSetProducer parentFilter, BitSetProducer childFilter)`
  Create ToParentBlockJoinSortField.
  `ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverseParents, boolean reverseChildren, BitSetProducer parentFilter, BitSetProducer childFilter)`
  Create ToParentBlockJoinSortField.
  `ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverse, Object parentMissingValue, Object childMissingValue, BitSetProducer parentFilter, BitSetProducer childFilter)`
  Create ToParentBlockJoinSortField.
  `ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverse, BitSetProducer parentFilter, BitSetProducer childFilter)`
  Create ToParentBlockJoinSortField.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `FieldComparator<?>`
  `getComparator(int numHits, Pruning pruning)`
  `int`
  `hashCode()`

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

  `getComparatorSource, getField, getIndexSorter, getMissingValue, getOptimizeSortWithIndexedData, getOptimizeSortWithPoints, getReverse, getType, needsScores, readType, rewrite, setMissingValue, setOptimizeSortWithIndexedData, setOptimizeSortWithPoints, toString`

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

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

- ## Constructor Details

  - ### ToParentBlockJoinSortField

    public ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverse, BitSetProducer parentFilter, BitSetProducer childFilter)
    Create ToParentBlockJoinSortField. The parent and child document ordering is based on the flag reverse. Missing values are treated as the default for the type.
    Parameters:
      `field` - The sort field on the nested / child level.
      `type` - The sort type on the nested / child level.
      `reverse` - Whether natural order should be reversed on both child and parent levels.
      `parentFilter` - Filter that identifies the parent documents.
      `childFilter` - Filter that defines which child documents participates in sorting.

  - ### ToParentBlockJoinSortField

    public ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverseParents, boolean reverseChildren, BitSetProducer parentFilter, BitSetProducer childFilter)
    Create ToParentBlockJoinSortField. Missing values are treated as the default for the type.
    Parameters:
      `field` - The sort field on the nested / child level.
      `type` - The sort type on the nested / child level.
      `reverseParents` - Whether natural order should be reversed on the parent level.
      `reverseChildren` - Whether natural order should be reversed on the nested / child document level.
      `parentFilter` - Filter that identifies the parent documents.
      `childFilter` - Filter that defines which child documents participates in sorting.

  - ### ToParentBlockJoinSortField

    public ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverse, Object parentMissingValue, Object childMissingValue, BitSetProducer parentFilter, BitSetProducer childFilter)
    Create ToParentBlockJoinSortField. The parent document ordering is based on child document ordering (reverse).
    Parameters:
      `field` - The sort field on the nested / child level.
      `type` - The sort type on the nested / child level.
      `reverse` - Whether natural order should be reversed on both child and parent levels.
      `parentMissingValue` - The missing value for parent documents that have no child documents. For Type.STRING use `SortField.STRING_FIRST` or `SortField.STRING_LAST`. For numeric types use the corresponding boxed type (e.g. `Integer` for Type.INT). Pass `null` for default behavior.
      `childMissingValue` - The missing value for child documents that lack the sort field. This value participates in the min/max selection among siblings. Type constraints are the same as for `parentMissingValue`. Pass `null` to skip children without a value.
      `parentFilter` - Filter that identifies the parent documents.
      `childFilter` - Filter that defines which child documents participates in sorting.

  - ### ToParentBlockJoinSortField

    public ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverseParents, boolean reverseChildren, Object parentMissingValue, Object childMissingValue, BitSetProducer parentFilter, BitSetProducer childFilter)
    Create ToParentBlockJoinSortField.
    Parameters:
      `field` - The sort field on the nested / child level.
      `type` - The sort type on the nested / child level.
      `reverseParents` - Whether natural order should be reversed on the parent level.
      `reverseChildren` - Whether natural order should be reversed on the nested / child document level.
      `parentMissingValue` - The missing value for parent documents whose children do not have a value for the sort field. For Type.STRING use `SortField.STRING_FIRST` or `SortField.STRING_LAST`. For numeric types use the corresponding boxed type (e.g. `Integer` for Type.INT). Pass `null` for default behavior.
      `childMissingValue` - The missing value for child documents that lack the sort field. This value participates in the min/max selection among siblings. Type constraints are the same as for `parentMissingValue`. Pass `null` to skip children without a value.
      `parentFilter` - Filter that identifies the parent documents.
      `childFilter` - Filter that defines which child documents participates in sorting.

- ## Method Details

  - ### getComparator

    public FieldComparator<?> getComparator(int numHits, Pruning pruning)
    Overrides:
      `getComparator` in class `SortField`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `SortField`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `SortField`