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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.SortField
SortField.Provider, SortField.Type
-
-
Field Summary
Fields Modifier and Type Field Description private BitSetProducer
childFilter
private boolean
order
private BitSetProducer
parentFilter
-
Fields inherited from class org.apache.lucene.search.SortField
FIELD_DOC, FIELD_SCORE, missingValue, STRING_FIRST, STRING_LAST
-
-
Constructor Summary
Constructors Constructor Description ToParentBlockJoinSortField(java.lang.String field, SortField.Type type, boolean reverse, boolean order, BitSetProducer parentFilter, BitSetProducer childFilter)
Create ToParentBlockJoinSortField.ToParentBlockJoinSortField(java.lang.String field, SortField.Type type, boolean reverse, BitSetProducer parentFilter, BitSetProducer childFilter)
Create ToParentBlockJoinSortField.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Returns true ifo
is equal to this.FieldComparator<?>
getComparator(int numHits, boolean enableSkipping)
Returns theFieldComparator
to use for sorting.private FieldComparator<?>
getDoubleComparator(int numHits)
private FieldComparator<?>
getFloatComparator(int numHits)
private FieldComparator<?>
getIntComparator(int numHits)
private FieldComparator<?>
getLongComparator(int numHits)
private FieldComparator<?>
getStringComparator(int numHits)
int
hashCode()
Returns a hash code for thisSortField
instance.-
Methods inherited from class org.apache.lucene.search.SortField
getBytesComparator, getComparatorSource, getField, getIndexSorter, getMissingValue, getOptimizeSortWithPoints, getReverse, getType, needsScores, readType, rewrite, setBytesComparator, setMissingValue, setOptimizeSortWithPoints, toString
-
-
-
-
Field Detail
-
order
private final boolean order
-
parentFilter
private final BitSetProducer parentFilter
-
childFilter
private final BitSetProducer childFilter
-
-
Constructor Detail
-
ToParentBlockJoinSortField
public ToParentBlockJoinSortField(java.lang.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(java.lang.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, boolean enableSkipping)
Description copied from class:SortField
Returns theFieldComparator
to use for sorting.- Overrides:
getComparator
in classSortField
- Parameters:
numHits
- number of top hits the queue will storeenableSkipping
- true if the comparator can skip documents viaLeafFieldComparator.competitiveIterator()
- Returns:
FieldComparator
to use when sorting
-
getStringComparator
private FieldComparator<?> getStringComparator(int numHits)
-
getIntComparator
private FieldComparator<?> getIntComparator(int numHits)
-
getLongComparator
private FieldComparator<?> getLongComparator(int numHits)
-
getFloatComparator
private FieldComparator<?> getFloatComparator(int numHits)
-
getDoubleComparator
private FieldComparator<?> getDoubleComparator(int numHits)
-
hashCode
public int hashCode()
Description copied from class:SortField
Returns a hash code for thisSortField
instance. If aFieldComparatorSource
was provided, it must properly implement hashCode (unless a singleton is always used).
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:SortField
Returns true ifo
is equal to this. If aFieldComparatorSource
was provided, it must properly implement equals (unless a singleton is always used).
-
-