org.apache.lucene.codecs.idversion

## Class IDVersionSegmentTermsEnum

- java.lang.Object
- - org.apache.lucene.index.TermsEnum
  - - org.apache.lucene.index.BaseTermsEnum
    - - org.apache.lucene.codecs.idversion.IDVersionSegmentTermsEnum

- All Implemented Interfaces:
    BytesRefIterator

      public final class IDVersionSegmentTermsEnum
      extends BaseTermsEnum

  Iterates through terms in this field; this class is public so users can cast it to call `seekExact(BytesRef, long)` for optimistic-concurrency, and also `getVersion()` to get the version of the currently seek'd term.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.index.TermsEnum

      `TermsEnum.SeekStatus`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.index.TermsEnum

      `EMPTY`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `docFreq()`
    `long` | `getVersion()` Get the version of the currently seek'd term; only valid if we are positioned.
    `ImpactsEnum` | `impacts(int flags)`
    `BytesRef` | `next()`
    `long` | `ord()`
    `PostingsEnum` | `postings(PostingsEnum reuse, int flags)`
    `TermsEnum.SeekStatus` | `seekCeil(BytesRef target)`
    `boolean` | `seekExact(BytesRef target)`
    `boolean` | `seekExact(BytesRef target, long minIDVersion)` Optimized version of `seekExact(BytesRef)` that can sometimes fail-fast if the version indexed with the requested ID is less than the specified minIDVersion.
    `void` | `seekExact(BytesRef target, TermState otherState)`
    `void` | `seekExact(long ord)`
    `BytesRef` | `term()`
    `TermState` | `termState()`
    `String` | `toString()`
    `long` | `totalTermFreq()`

    - ### Methods inherited from class org.apache.lucene.index.BaseTermsEnum

      `attributes`

    - ### Methods inherited from class org.apache.lucene.index.TermsEnum

      `postings`

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

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

- - ### Method Detail

    - #### seekExact

          public boolean seekExact(BytesRef target)
                            throws IOException

      Overrides:
        `seekExact` in class `BaseTermsEnum`
      Throws:
        `IOException`

    - #### getVersion

          public long getVersion()

      Get the version of the currently seek'd term; only valid if we are positioned.

    - #### seekExact

          public boolean seekExact(BytesRef target,
                                   long minIDVersion)
                            throws IOException

      Optimized version of `seekExact(BytesRef)` that can sometimes fail-fast if the version indexed with the requested ID is less than the specified minIDVersion. Applications that index a monotonically increasing global version with each document can use this for fast optimistic concurrency.
      Throws:
        `IOException`

    - #### seekCeil

          public TermsEnum.SeekStatus seekCeil(BytesRef target)
                                        throws IOException

      Specified by:
        `seekCeil` in class `TermsEnum`
      Throws:
        `IOException`

    - #### next

          public BytesRef next()
                        throws IOException

      Throws:
        `IOException`

    - #### term

          public BytesRef term()

      Specified by:
        `term` in class `TermsEnum`

    - #### docFreq

          public int docFreq()
                      throws IOException

      Specified by:
        `docFreq` in class `TermsEnum`
      Throws:
        `IOException`

    - #### totalTermFreq

          public long totalTermFreq()
                             throws IOException

      Specified by:
        `totalTermFreq` in class `TermsEnum`
      Throws:
        `IOException`

    - #### postings

          public PostingsEnum postings(PostingsEnum reuse,
                                       int flags)
                                throws IOException

      Specified by:
        `postings` in class `TermsEnum`
      Throws:
        `IOException`

    - #### impacts

          public ImpactsEnum impacts(int flags)
                              throws IOException

      Specified by:
        `impacts` in class `TermsEnum`
      Throws:
        `IOException`

    - #### seekExact

          public void seekExact(BytesRef target,
                                TermState otherState)

      Overrides:
        `seekExact` in class `BaseTermsEnum`

    - #### termState

          public TermState termState()
                              throws IOException

      Overrides:
        `termState` in class `BaseTermsEnum`
      Throws:
        `IOException`

    - #### seekExact

          public void seekExact(long ord)

      Specified by:
        `seekExact` in class `TermsEnum`

    - #### ord

          public long ord()

      Specified by:
        `ord` in class `TermsEnum`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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