java.lang.Object | ||
↳ | org.apache.lucene.search.FieldComparator | |
↳ | org.apache.lucene.search.FieldComparator.StringOrdValComparator |
Sorts by field's natural String sort order, using
ordinals. This is functionally equivalent to FieldComparator.StringValComparator
, but it first resolves the string
to their relative ordinal positions (using the index
returned by getStringIndex(IndexReader, String)
), and
does most comparisons using the ordinals. For medium
to large results, this comparator will be much faster
than FieldComparator.StringValComparator
. For very small
result sets it may be slower.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compare hit at slot1 with hit at slot2.
| |||||||||||
Compare the bottom of the queue with doc.
| |||||||||||
This method is called when a new hit is competitive.
| |||||||||||
Set the bottom slot, ie the "weakest" (sorted last)
entry in the queue.
| |||||||||||
Set a new Reader.
| |||||||||||
Return the actual value in the slot.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.search.FieldComparator
| |||||||||||
From class
java.lang.Object
|
Compare hit at slot1 with hit at slot2.
slot1 | first slot to compare |
---|---|
slot2 | second slot to compare |
Compare the bottom of the queue with doc. This will
only invoked after setBottom has been called. This
should return the same result as compare(int, int)
} as if bottom were slot1 and the new
document were slot 2.
For a search that hits many results, this method will be the hotspot (invoked by far the most frequently).
doc | that was hit |
---|
This method is called when a new hit is competitive. You should copy any state associated with this document that will be required for future comparisons, into the specified slot.
slot | which slot to copy the hit to |
---|---|
doc | docID relative to current reader |
Set the bottom slot, ie the "weakest" (sorted last)
entry in the queue. When compareBottom(int)
is
called, you should compare against this slot. This
will always be called before compareBottom(int)
.
bottom | the currently weakest (sorted last) slot in the queue |
---|
Set a new Reader. All doc correspond to the current Reader.
reader | current reader |
---|---|
docBase | docBase of this reader |
IOException |
---|
Return the actual value in the slot.
slot | the value |
---|