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, STRING_FIRST, STRING_LAST`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverse, BitSetProducer parentFilter, BitSetProducer childFilter)` Create ToParentBlockJoinSortField.
    `ToParentBlockJoinSortField(String field, SortField.Type type, boolean reverse, boolean order, BitSetProducer parentFilter, BitSetProducer childFilter)` Create ToParentBlockJoinSortField.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `FieldComparator<?>` | `getComparator(int numHits, int sortPos)`
    `int` | `hashCode()`

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

      `getBytesComparator, getCanUsePoints, getComparatorSource, getField, getIndexSorter, getMissingValue, getReverse, getType, needsScores, readType, rewrite, setBytesComparator, setCanUsePoints, setMissingValue, toString`

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

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

- - ### Constructor Detail

    - #### ToParentBlockJoinSortField

          public ToParentBlockJoinSortField(String field,
                                            SortField.Type type,
                                            boolean reverse,
                                            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 the nested / child 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,
                                            boolean order,
                                            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.
        `reverse` - Whether natural order should be reversed on the nested / child document level.
        `order` - Whether natural order should be reversed on the parent level.
        `parentFilter` - Filter that identifies the parent documents.
        `childFilter` - Filter that defines which child documents participates in sorting.

  - ### Method Detail

    - #### getComparator

          public FieldComparator<?> getComparator(int numHits,
                                                  int sortPos)

      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`

Copyright © 2000-2024 Apache Software Foundation. All Rights Reserved.