Class FSTDictionary.Builder
- java.lang.Object
-
- org.apache.lucene.codecs.uniformsplit.FSTDictionary.Builder
-
- All Implemented Interfaces:
IndexDictionary.Builder
- Enclosing class:
- FSTDictionary
public static class FSTDictionary.Builder extends java.lang.Object implements IndexDictionary.Builder
Builds an immutableFSTDictionary
.
-
-
Field Summary
Fields Modifier and Type Field Description protected Builder<java.lang.Long>
fstBuilder
protected IntsRefBuilder
scratchInts
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(BytesRef blockKey, long blockFilePointer)
Adds a [block key - block file pointer] entry to the dictionary.FSTDictionary
build()
-
-
-
Field Detail
-
fstBuilder
protected final Builder<java.lang.Long> fstBuilder
-
scratchInts
protected final IntsRefBuilder scratchInts
-
-
Method Detail
-
add
public void add(BytesRef blockKey, long blockFilePointer)
Description copied from interface:IndexDictionary.Builder
Adds a [block key - block file pointer] entry to the dictionary.The Uniform Split technique adds block keys in the dictionary. See
BlockReader
andTermBytes
for more info about block key and minimal distinguishing prefix (MDP).All block keys are added in strictly increasing order of the block file pointers, this allows long encoding optimizations such as with
PositiveIntOutputs
forFST
.- Specified by:
add
in interfaceIndexDictionary.Builder
- Parameters:
blockKey
- The block key which is the minimal distinguishing prefix (MDP) of the first term of a block.blockFilePointer
- Non-negative file pointer to the start of the block in the block file.
-
build
public FSTDictionary build()
- Specified by:
build
in interfaceIndexDictionary.Builder
-
-