public class MappedSortComparator
extends org.apache.lucene.search.FieldComparatorSource
Modifier and Type | Class and Description |
---|---|
class |
MappedSortComparator.InternalFieldComparator |
Constructor and Description |
---|
MappedSortComparator(LuceneFieldSorter sorter) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Object |
getComparable(String termtext)
Returns an object which, when sorted according by the comparator returned from
LuceneFieldSorter.getComparator() , will order the Term values in the correct order. |
Comparator |
getComparator() |
int |
hashCode() |
org.apache.lucene.search.FieldComparator |
newComparator(String fieldname,
int numHits,
int sortPos,
boolean reversed) |
public MappedSortComparator(LuceneFieldSorter sorter)
public org.apache.lucene.search.FieldComparator newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException
newComparator
in class org.apache.lucene.search.FieldComparatorSource
IOException
public Object getComparable(String termtext)
LuceneFieldSorter.getComparator()
, will order the Term values in the correct order. For example, if the
Terms contained integer values, this method would return new Integer(termtext)
. Note that this
might not always be the most efficient implementation - for this particular example, a better implementation
might be to make a ScoreDocLookupComparator that uses an internal lookup table of int.
termtext
- The textual value of the term.termtext
that can be sorted by LuceneFieldSorter.getComparator()
Comparable
,
FieldComparator
public Comparator getComparator()
Copyright © 2002-2016 Atlassian. All Rights Reserved.