private class TotalHitsComparator.HitsComp
extends Object
implements ScoreDocComparator
Modifier | Constructor and Description |
---|---|
private |
HitsComp() |
Modifier and Type | Method and Description |
---|---|
int |
compare(ScoreDoc d1,
ScoreDoc d2)
Compares two ScoreDoc objects and returns a result indicating their
sort order.
|
int |
sortType()
Returns the type of sort.
|
Comparable |
sortValue(ScoreDoc doc)
Returns the value used to sort the given document.
|
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 doc)
sortValue
in interface ScoreDocComparator
doc
- The 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