org.apache.lucene.codecs

## Class TermVectorsReader

- java.lang.Object
- - org.apache.lucene.codecs.TermVectorsReader

- All Implemented Interfaces:
    Closeable, AutoCloseable, Cloneable, Accountable
  Direct Known Subclasses:
    CompressingTermVectorsReader

      public abstract class TermVectorsReader
      extends Object
      implements Cloneable, Closeable, Accountable

  Codec API for reading term vectors:
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.lucene.util.Accountable

      `NULL_ACCOUNTABLE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TermVectorsReader()` Sole constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `checkIntegrity()` Checks consistency of this reader.
    `abstract TermVectorsReader` | `clone()` Create a clone that one caller at a time may use to read term vectors.
    `abstract Fields` | `get(int doc)` Returns term vectors for this document, or null if term vectors were not indexed.
    `TermVectorsReader` | `getMergeInstance()` Returns an instance optimized for merging.

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.io.Closeable

      `close`

    - ### Methods inherited from interface org.apache.lucene.util.Accountable

      `getChildResources, ramBytesUsed`

- - ### Constructor Detail

    - #### TermVectorsReader

          protected TermVectorsReader()

      Sole constructor. (For invocation by subclass constructors, typically implicit.)

  - ### Method Detail

    - #### get

          public abstract Fields get(int doc)
                              throws IOException

      Returns term vectors for this document, or null if term vectors were not indexed. If offsets are available they are in an `OffsetAttribute` available from the `PostingsEnum`.
      Throws:
        `IOException`

    - #### checkIntegrity

          public abstract void checkIntegrity()
                                       throws IOException

      Checks consistency of this reader.

      Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.

      Throws:
        `IOException`
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### clone

          public abstract TermVectorsReader clone()

      Create a clone that one caller at a time may use to read term vectors.
      Overrides:
        `clone` in class `Object`

    - #### getMergeInstance

          public TermVectorsReader getMergeInstance()

      Returns an instance optimized for merging. This instance may only be consumed in the thread that called `getMergeInstance()`.

      The default implementation returns `this`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.