org.apache.lucene.index

## Class DocsEnum

- java.lang.Object
- - org.apache.lucene.search.DocIdSetIterator
  - - org.apache.lucene.index.PostingsEnum
    - - org.apache.lucene.index.DocsEnum

- Direct Known Subclasses:
    DocsAndPositionsEnum

  Deprecated.
  Use `PostingsEnum` instead.

      @Deprecated
      public abstract class DocsEnum
      extends PostingsEnum

  Iterates through the documents and term freqs. NOTE: you must first call `DocIdSetIterator.nextDoc()` before using any of the per-doc methods.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `FLAG_FREQS` Deprecated. Flag to pass to `TermsEnum.docs(Bits,DocsEnum,int)` if you require term frequencies in the returned enum.
    `static int` | `FLAG_NONE` Deprecated. Flag to pass to `TermsEnum.docs(Bits,DocsEnum,int)` if you don't require term frequencies in the returned enum.

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

      `ALL, FREQS, NONE, OFFSETS, PAYLOADS, POSITIONS`

    - ### Fields inherited from class org.apache.lucene.search.DocIdSetIterator

      `NO_MORE_DOCS`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `endOffset()` Deprecated. Returns end offset for the current position, or -1 if offsets were not indexed.
    `BytesRef` | `getPayload()` Deprecated. Returns the payload at this position, or null if no payload was indexed.
    `int` | `nextPosition()` Deprecated. Returns the next position, or -1 if positions were not indexed.
    `int` | `startOffset()` Deprecated. Returns start offset for the current position, or -1 if offsets were not indexed.

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

      `attributes, featureRequested, freq`

    - ### Methods inherited from class org.apache.lucene.search.DocIdSetIterator

      `advance, all, cost, docID, empty, nextDoc, slowAdvance`

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

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

- - ### Field Detail

    - #### FLAG_NONE

          public static final int FLAG_NONE

      Deprecated.
      Flag to pass to `TermsEnum.docs(Bits,DocsEnum,int)` if you don't require term frequencies in the returned enum. When passed to `TermsEnum.docsAndPositions(Bits,DocsAndPositionsEnum,int)` means that no offsets and payloads will be returned.
      See Also:
        Constant Field Values

    - #### FLAG_FREQS

          public static final int FLAG_FREQS

      Deprecated.
      Flag to pass to `TermsEnum.docs(Bits,DocsEnum,int)` if you require term frequencies in the returned enum.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DocsEnum

          protected DocsEnum()

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

  - ### Method Detail

    - #### nextPosition

          public int nextPosition()
                           throws IOException

      Deprecated.
      Description copied from class: `PostingsEnum`
      Returns the next position, or -1 if positions were not indexed. Calling this more than `PostingsEnum.freq()` times is undefined.
      Specified by:
        `nextPosition` in class `PostingsEnum`
      Throws:
        `IOException`

    - #### startOffset

          public int startOffset()
                          throws IOException

      Deprecated.
      Description copied from class: `PostingsEnum`
      Returns start offset for the current position, or -1 if offsets were not indexed.
      Specified by:
        `startOffset` in class `PostingsEnum`
      Throws:
        `IOException`

    - #### endOffset

          public int endOffset()
                        throws IOException

      Deprecated.
      Description copied from class: `PostingsEnum`
      Returns end offset for the current position, or -1 if offsets were not indexed.
      Specified by:
        `endOffset` in class `PostingsEnum`
      Throws:
        `IOException`

    - #### getPayload

          public BytesRef getPayload()
                              throws IOException

      Deprecated.
      Description copied from class: `PostingsEnum`
      Returns the payload at this position, or null if no payload was indexed. You should not modify anything (neither members of the returned BytesRef nor bytes in the byte[]).
      Specified by:
        `getPayload` in class `PostingsEnum`
      Throws:
        `IOException`

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