public class Siren10PostingsWriter
extends org.apache.lucene.codecs.PostingsWriterBase
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
logger |
Constructor and Description |
---|
Siren10PostingsWriter(org.apache.lucene.index.SegmentWriteState state,
int blockSkipInterval,
Siren10BlockStreamFactory factory) |
Siren10PostingsWriter(org.apache.lucene.index.SegmentWriteState state,
Siren10BlockStreamFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
addPosition(int position,
org.apache.lucene.util.BytesRef payload,
int startOffset,
int endOffset) |
void |
close() |
void |
finishDoc() |
void |
finishTerm(org.apache.lucene.codecs.TermStats stats)
Called when we are done adding docs to this term
|
void |
flushTermsBlock(int start,
int count) |
org.apache.lucene.codecs.TermStats |
merge(org.apache.lucene.index.MergeState mergeState,
org.apache.lucene.index.DocsEnum postings,
org.apache.lucene.util.FixedBitSet visitedDocs)
Default merge impl: append documents, nodes and positions, mapping around
deletes.
|
void |
setField(org.apache.lucene.index.FieldInfo fieldInfo) |
void |
start(org.apache.lucene.store.IndexOutput termsOut) |
void |
startDoc(int docID,
int termDocFreq)
Adds a new doc in this term.
|
void |
startTerm() |
public Siren10PostingsWriter(org.apache.lucene.index.SegmentWriteState state, Siren10BlockStreamFactory factory) throws IOException
IOException
public Siren10PostingsWriter(org.apache.lucene.index.SegmentWriteState state, int blockSkipInterval, Siren10BlockStreamFactory factory) throws IOException
IOException
public void start(org.apache.lucene.store.IndexOutput termsOut) throws IOException
start
in class org.apache.lucene.codecs.PostingsWriterBase
IOException
public void startTerm() throws IOException
startTerm
in class org.apache.lucene.codecs.PostingsWriterBase
IOException
public void setField(org.apache.lucene.index.FieldInfo fieldInfo)
setField
in class org.apache.lucene.codecs.PostingsWriterBase
public void startDoc(int docID, int termDocFreq) throws IOException
termDocFreq
parameter is ignored as term frequency in document is
not used.
startDoc
in class org.apache.lucene.codecs.PostingsConsumer
IOException
public void addPosition(int position, org.apache.lucene.util.BytesRef payload, int startOffset, int endOffset) throws IOException
addPosition
in class org.apache.lucene.codecs.PostingsConsumer
IOException
public void finishDoc()
finishDoc
in class org.apache.lucene.codecs.PostingsConsumer
public void finishTerm(org.apache.lucene.codecs.TermStats stats) throws IOException
finishTerm
in class org.apache.lucene.codecs.PostingsWriterBase
IOException
public void flushTermsBlock(int start, int count) throws IOException
flushTermsBlock
in class org.apache.lucene.codecs.PostingsWriterBase
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class org.apache.lucene.codecs.PostingsWriterBase
IOException
public org.apache.lucene.codecs.TermStats merge(org.apache.lucene.index.MergeState mergeState, org.apache.lucene.index.DocsEnum postings, org.apache.lucene.util.FixedBitSet visitedDocs) throws IOException
Bypass the Siren10PostingsWriter
methods and work directly with
the BlockWriters for maximum efficiency.
TODO - Optimisation: If document blocks match the block size, and no document deleted, then it would be possible to copy block directly as byte array, avoiding decoding and encoding.
merge
in class org.apache.lucene.codecs.PostingsConsumer
IOException
Copyright © 2014. All rights reserved.