Class TermVectorsWriter

java.lang.Object
org.apache.lucene.codecs.TermVectorsWriter
All Implemented Interfaces:
Closeable, AutoCloseable, Accountable
Direct Known Subclasses:
Lucene90CompressingTermVectorsWriter, SimpleTextTermVectorsWriter

public abstract class TermVectorsWriter extends Object implements Closeable, Accountable
Codec API for writing term vectors:
  1. For every document, startDocument(int) is called, informing the Codec how many fields will be written.
  2. startField(FieldInfo, int, boolean, boolean, boolean) is called for each field in the document, informing the codec how many terms will be written for that field, and whether or not positions, offsets, or payloads are enabled.
  3. Within each field, startTerm(BytesRef, int) is called for each term.
  4. If offsets and/or positions are enabled, then addPosition(int, int, int, BytesRef) will be called for each term occurrence.
  5. After all documents have been written, finish(int) is called for verification/sanity-checks.
  6. Finally the writer is closed (close())
  • Constructor Details

    • TermVectorsWriter

      protected TermVectorsWriter()
      Sole constructor. (For invocation by subclass constructors, typically implicit.)
  • Method Details