private class SparseStringComparator.SparseComp
extends Object
implements ScoreDocComparator
Modifier and Type | Field and Description |
---|---|
(package private) ArrayList |
entries |
(package private) boolean |
flipEmpty |
Constructor and Description |
---|
SparseComp(IndexReader reader,
String field) |
Modifier and Type | Method and Description |
---|---|
int |
compare(ScoreDoc d1,
ScoreDoc d2)
Compares two ScoreDoc objects and returns a result indicating their
sort order.
|
private SparseStringComparator.Entry |
findEntry(int docId)
Retrieve the entry for a given document, or null if not found.
|
int |
sortType()
Returns the type of sort.
|
Comparable |
sortValue(ScoreDoc i)
Returns the value used to sort the given document.
|
SparseComp(IndexReader reader, String field) throws IOException
IOException
private SparseStringComparator.Entry findEntry(int docId)
public int compare(ScoreDoc d1, ScoreDoc d2)
compare
in interface ScoreDocComparator
d1
- First ScoreDocd2
- Second ScoreDoc-1
if i
should come before j
1
if i
should come after j
0
if they are equalComparator
public Comparable sortValue(ScoreDoc i)
sortValue
in interface ScoreDocComparator
i
- Documentpublic int sortType()
SortField.SCORE
, SortField.DOC
, SortField.STRING
, SortField.INTEGER
,
SortField.FLOAT
or SortField.CUSTOM
. It is not valid to return SortField.AUTO
.
This is used by multisearchers to determine how to collate results from their searchers.sortType
in interface ScoreDocComparator
SortField