org.apache.lucene.codecs.simpletext
Class SimpleTextDocValuesConsumer
java.lang.Object
org.apache.lucene.codecs.DocValuesConsumer
org.apache.lucene.codecs.simpletext.SimpleTextDocValuesConsumer
public class SimpleTextDocValuesConsumer
- extends DocValuesConsumer
Writes plain-text DocValues.
FOR RECREATIONAL USE ONLY
- WARNING: This API is experimental and might change in incompatible ways in the next release.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
scratch
protected BytesRef scratch
maxDocId
protected int maxDocId
segment
protected final String segment
dir
protected final Directory dir
ctx
protected final IOContext ctx
type
protected final DocValues.Type type
hash
protected final BytesRefHash hash
SimpleTextDocValuesConsumer
public SimpleTextDocValuesConsumer(String segment,
Directory dir,
IOContext ctx,
DocValues.Type type,
String segmentSuffix)
add
public void add(int docID,
IndexableField value)
throws IOException
- Description copied from class:
DocValuesConsumer
- Adds the given
IndexableField
instance to this
DocValuesConsumer
- Specified by:
add
in class DocValuesConsumer
- Parameters:
docID
- the document ID to add the value for. The docID must always
increase or be 0 if it is the first call to this method.value
- the value to add
- Throws:
IOException
- if an IOException
occurs
getHeader
protected BytesRef getHeader()
finish
public void finish(int docCount)
throws IOException
- Description copied from class:
DocValuesConsumer
- Called when the consumer of this API is done adding values.
- Specified by:
finish
in class DocValuesConsumer
- Parameters:
docCount
- the total number of documents in this DocValuesConsumer
.
Must be greater than or equal the last given docID to
DocValuesConsumer.add(int, IndexableField)
.
- Throws:
IOException
writeDoc
protected void writeDoc(IndexOutput output,
int docId,
BytesRef spare)
throws IOException
- Throws:
IOException
getType
protected DocValues.Type getType()
- Specified by:
getType
in class DocValuesConsumer
getValueSize
public int getValueSize()
- Description copied from class:
DocValuesConsumer
- Returns the value size this consumer accepts or -1 iff this
consumer is value size agnostic ie. accepts variable length values.
NOTE: the return value is undefined until the consumer has successfully
consumed at least one value.
- Specified by:
getValueSize
in class DocValuesConsumer
- Returns:
- the value size this consumer accepts or -1 iff this
consumer is value size agnostic ie. accepts variable length values.
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.