Class ExternalRefSorter
java.lang.Object
org.apache.lucene.search.suggest.fst.ExternalRefSorter
- All Implemented Interfaces:
Closeable,AutoCloseable,BytesRefSorter
Builds and iterates over sequences stored on disk.
-
Constructor Summary
ConstructorsConstructorDescriptionExternalRefSorter(Sort sort) Will buffer all sequences to a temporary file and then sort (all on-disk). -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a single suggestion entry (possibly compound with its bucket).voidclose()Removes any written temporary files.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
-
ExternalRefSorter
Will buffer all sequences to a temporary file and then sort (all on-disk).- Throws:
IOException
-
-
Method Details
-
add
Description copied from interface:BytesRefSorterAdds a single suggestion entry (possibly compound with its bucket).- Specified by:
addin interfaceBytesRefSorter- Throws:
IOException- If an I/O exception occurs.
-
iterator
Description copied from interface:BytesRefSorterSorts the entries added inBytesRefSorter.add(BytesRef)and returns an iterator over all sorted entries.- Specified by:
iteratorin interfaceBytesRefSorter- Throws:
IOException- If an I/O exception occurs.
-
close
Removes any written temporary files.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getComparator
Description copied from interface:BytesRefSorterComparator used to determine the sort order of entries.- Specified by:
getComparatorin interfaceBytesRefSorter
-