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.- WARNING: This API is experimental and might change in incompatible ways in the next release.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorsConstructorDescriptionInMemorySorter(Comparator<BytesRef> comparator) Creates an InMemorySorter, sorting entries by the provided comparator. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds 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.
-
Constructor Details
-
InMemorySorter
Creates an InMemorySorter, sorting entries by the provided comparator.
-
-
Method Details
-
add
Description copied from interface:BytesRefSorterAdds a single suggestion entry (possibly compound with its bucket).- Specified by:
addin interfaceBytesRefSorter
-
iterator
Description copied from interface:BytesRefSorterSorts the entries added inBytesRefSorter.add(BytesRef)and returns an iterator over all sorted entries.- Specified by:
iteratorin interfaceBytesRefSorter
-
getComparator
Description copied from interface:BytesRefSorterComparator used to determine the sort order of entries.- Specified by:
getComparatorin interfaceBytesRefSorter
-