public abstract class CompletionPostingsFormat extends PostingsFormat
A PostingsFormat
which supports document suggestion based on
indexed SuggestField
s.
Document suggestion is based on an weighted FST which map analyzed
terms of a SuggestField
to its surface form and document id.
Files:
The .lkp file contains an FST for each suggest field
CodecHeader
FST<Long, BytesRef>
CodecFooter
Notes:
CodecHeader
storing the version information
for the Completion implementation.The .cmp file contains an index into the completion dictionary, so that it can be accessed randomly.
CodecHeader
Uint32
Uint32
Uint64
Uint64
Uint64
Byte
CodecFooter
Notes:
CodecHeader
storing the version information
for the Completion implementation.FieldInfos
. (.fnm)Modifier and Type | Class and Description |
---|---|
static class |
CompletionPostingsFormat.FSTLoadMode
An enum that allows to control if suggester FSTs are loaded into memory or read off-heap
|
Modifier and Type | Field and Description |
---|---|
(package private) static int |
COMPLETION_CODEC_VERSION |
(package private) static int |
COMPLETION_VERSION_CURRENT |
(package private) static java.lang.String |
DICT_EXTENSION |
private CompletionPostingsFormat.FSTLoadMode |
fstLoadMode |
(package private) static java.lang.String |
INDEX_EXTENSION |
EMPTY
Constructor and Description |
---|
CompletionPostingsFormat(java.lang.String name)
Used only by core Lucene at read-time via Service Provider instantiation
|
CompletionPostingsFormat(java.lang.String name,
CompletionPostingsFormat.FSTLoadMode fstLoadMode)
Creates a
CompletionPostingsFormat that will
use the provided fstLoadMode to determine
if the completion FST should be loaded on or off heap. |
Modifier and Type | Method and Description |
---|---|
protected abstract PostingsFormat |
delegatePostingsFormat()
Concrete implementation should specify the delegating postings format
|
FieldsConsumer |
fieldsConsumer(SegmentWriteState state)
Writes a new segment
|
FieldsProducer |
fieldsProducer(SegmentReadState state)
Reads a segment.
|
availablePostingsFormats, forName, getName, reloadPostingsFormats, toString
static final int COMPLETION_CODEC_VERSION
static final int COMPLETION_VERSION_CURRENT
static final java.lang.String INDEX_EXTENSION
static final java.lang.String DICT_EXTENSION
private final CompletionPostingsFormat.FSTLoadMode fstLoadMode
public CompletionPostingsFormat(java.lang.String name)
public CompletionPostingsFormat(java.lang.String name, CompletionPostingsFormat.FSTLoadMode fstLoadMode)
CompletionPostingsFormat
that will
use the provided fstLoadMode
to determine
if the completion FST should be loaded on or off heap.protected abstract PostingsFormat delegatePostingsFormat()
public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws java.io.IOException
PostingsFormat
fieldsConsumer
in class PostingsFormat
java.io.IOException
public FieldsProducer fieldsProducer(SegmentReadState state) throws java.io.IOException
PostingsFormat
fieldsProducer
in class PostingsFormat
java.io.IOException