Package org.apache.lucene.search.suggest
Class InMemorySorter
java.lang.Object
org.apache.lucene.search.suggest.InMemorySorter
- All Implemented Interfaces:
BytesRefSorter
An
BytesRefSorter
that keeps all the entries in memory.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BytesRefArray
private boolean
private final Comparator<BytesRef>
-
Constructor Summary
ConstructorsConstructorDescriptionInMemorySorter
(Comparator<BytesRef> comparator) Creates an InMemorySorter, sorting entries by the provided comparator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a single suggestion entry (possibly compound with its bucket).Comparator used to determine the sort order of entries.iterator()
Sorts the entries added inBytesRefSorter.add(BytesRef)
and returns an iterator over all sorted entries.
-
Field Details
-
buffer
-
closed
private boolean closed -
comparator
-
-
Constructor Details
-
InMemorySorter
Creates an InMemorySorter, sorting entries by the provided comparator.
-
-
Method Details
-
add
Description copied from interface:BytesRefSorter
Adds a single suggestion entry (possibly compound with its bucket).- Specified by:
add
in interfaceBytesRefSorter
-
iterator
Description copied from interface:BytesRefSorter
Sorts the entries added inBytesRefSorter.add(BytesRef)
and returns an iterator over all sorted entries.- Specified by:
iterator
in interfaceBytesRefSorter
-
getComparator
Description copied from interface:BytesRefSorter
Comparator used to determine the sort order of entries.- Specified by:
getComparator
in interfaceBytesRefSorter
-