Class FSTDictionary
- java.lang.Object
-
- org.apache.lucene.codecs.uniformsplit.FSTDictionary
-
- All Implemented Interfaces:
IndexDictionary
public class FSTDictionary extends Object implements IndexDictionary
Immutable statelessFST-based index dictionary kept in memory.Use
IndexDictionary.Builderto build theIndexDictionary.Create a stateful
IndexDictionary.Browserto seek a term in thisIndexDictionaryand 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
FSTas a byte array, and the incremental encoding of the leaves block pointer values, which are long integers in increasing order, withPositiveIntOutputs.
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
Nested Classes Modifier and Type Class Description protected classFSTDictionary.BrowserStatefulFSTDictionary.Browserto seek a term in thisFSTDictionaryand get its corresponding block file pointer in the block file.static classFSTDictionary.BrowserSupplierProvides statefulFSTDictionary.Browserto seek in theFSTDictionary.static classFSTDictionary.BuilderBuilds an immutableFSTDictionary.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFSTDictionary(FST<Long> fst)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FSTDictionary.Browserbrowser()Creates a newIndexDictionary.Browser.protected static FSTDictionaryread(DataInput input, BlockDecoder blockDecoder, boolean isFSTOnHeap)Reads aFSTDictionaryfrom the provided input.voidwrite(DataOutput output, BlockEncoder blockEncoder)Writes this dictionary to the provided output.
-
-
-
Method Detail
-
write
public void write(DataOutput output, BlockEncoder blockEncoder) throws IOException
Description copied from interface:IndexDictionaryWrites this dictionary to the provided output.- Specified by:
writein interfaceIndexDictionaryblockEncoder- TheBlockEncoderfor 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 aFSTDictionaryfrom the provided input.- Parameters:
blockDecoder- TheBlockDecoderto use for specific decoding; or null if none.- Throws:
IOException
-
browser
public FSTDictionary.Browser browser()
Description copied from interface:IndexDictionaryCreates a newIndexDictionary.Browser.- Specified by:
browserin interfaceIndexDictionary
-
-