Class FSTDictionary
java.lang.Object
org.apache.lucene.codecs.uniformsplit.FSTDictionary
- All Implemented Interfaces:
IndexDictionary
Immutable stateless
FST
-based index dictionary kept in memory.
Use IndexDictionary.Builder
to build the IndexDictionary
.
Create a stateful IndexDictionary.Browser
to seek a term in this IndexDictionary
and get its corresponding block file pointer to the terms block file.
Its greatest advantage is to be very compact in memory thanks to both the compaction of the
FST
as a byte array, and the incremental encoding of the leaves block pointer values,
which are long integers in increasing order, with PositiveIntOutputs
.
With a compact dictionary in memory we can increase the number of blocks. This allows us to
reduce the average block size, which means faster scan inside a block.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
StatefulFSTDictionary.Browser
to seek a term in thisFSTDictionary
and get its corresponding block file pointer in the block file.static class
Provides statefulFSTDictionary.Browser
to seek in theFSTDictionary
.static class
Builds an immutableFSTDictionary
. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbrowser()
Creates a newIndexDictionary.Browser
.protected static FSTDictionary
read
(DataInput input, BlockDecoder blockDecoder, boolean isFSTOnHeap) Reads aFSTDictionary
from the provided input.void
write
(DataOutput output, BlockEncoder blockEncoder) Writes this dictionary to the provided output.
-
Field Details
-
fst
-
-
Constructor Details
-
FSTDictionary
-
-
Method Details
-
write
Description copied from interface:IndexDictionary
Writes this dictionary to the provided output.- Specified by:
write
in interfaceIndexDictionary
blockEncoder
- TheBlockEncoder
for specific encoding of this index dictionary; or null if none.- Throws:
IOException
-
read
protected static FSTDictionary read(DataInput input, BlockDecoder blockDecoder, boolean isFSTOnHeap) throws IOException Reads aFSTDictionary
from the provided input.- Parameters:
blockDecoder
- TheBlockDecoder
to use for specific decoding; or null if none.- Throws:
IOException
-
browser
Description copied from interface:IndexDictionary
Creates a newIndexDictionary.Browser
.- Specified by:
browser
in interfaceIndexDictionary
-