public class BytesRefFieldComparatorSource extends IndexFieldData.XFieldComparatorSource
IndexFieldData.XFieldComparatorSource.Nested
Constructor and Description |
---|
BytesRefFieldComparatorSource(IndexFieldData<?> indexFieldData,
java.lang.Object missingValue,
MultiValueMode sortMode,
IndexFieldData.XFieldComparatorSource.Nested nested) |
Modifier and Type | Method and Description |
---|---|
protected SortedBinaryDocValues |
getValues(org.apache.lucene.index.LeafReaderContext context) |
java.lang.Object |
missingValue(boolean reversed)
Return a missing value that is understandable by
SortField.setMissingValue(Object) . |
org.apache.lucene.search.FieldComparator<?> |
newComparator(java.lang.String fieldname,
int numHits,
int sortPos,
boolean reversed) |
org.apache.lucene.search.SortField.Type |
reducedType() |
protected void |
setScorer(org.apache.lucene.search.Scorer scorer) |
missingObject, sortMissingFirst, sortMissingLast
public BytesRefFieldComparatorSource(IndexFieldData<?> indexFieldData, java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested)
public org.apache.lucene.search.SortField.Type reducedType()
reducedType
in class IndexFieldData.XFieldComparatorSource
public java.lang.Object missingValue(boolean reversed)
IndexFieldData.XFieldComparatorSource
SortField.setMissingValue(Object)
.
Most implementations return null because they already replace the value at the fielddata level.
However this can't work in case of strings since there is no such thing as a string which
compares greater than any other string, so in that case we need to return
SortField.STRING_FIRST
or SortField.STRING_LAST
so that the coordinating node
knows how to deal with null values.missingValue
in class IndexFieldData.XFieldComparatorSource
protected SortedBinaryDocValues getValues(org.apache.lucene.index.LeafReaderContext context) throws java.io.IOException
java.io.IOException
protected void setScorer(org.apache.lucene.search.Scorer scorer)
public org.apache.lucene.search.FieldComparator<?> newComparator(java.lang.String fieldname, int numHits, int sortPos, boolean reversed)
newComparator
in class org.apache.lucene.search.FieldComparatorSource