Package org.apache.lucene.codecs.uniformsplit.sharedterms

## Class STMergingBlockReader

- java.lang.Object
- - org.apache.lucene.index.TermsEnum
  - - org.apache.lucene.index.BaseTermsEnum
    - - org.apache.lucene.codecs.uniformsplit.BlockReader
      - - org.apache.lucene.codecs.uniformsplit.sharedterms.STBlockReader
        - - org.apache.lucene.codecs.uniformsplit.sharedterms.STMergingBlockReader

- All Implemented Interfaces:
    `Accountable`, `BytesRefIterator`

      public class STMergingBlockReader
      extends STBlockReader

  `TermsEnum` used when merging segments, to enumerate the terms of an input segment and get all the fields `TermState`s of each term.

  It only supports calls to `next()` and no seek method.

  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### 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.codecs.uniformsplit.sharedterms.STBlockReader

      `fieldInfos`

    - ### Fields inherited from class org.apache.lucene.codecs.uniformsplit.BlockReader

      `blockDecoder, blockFirstLineStart, blockHeader, blockHeaderReader, blockInput, blockLine, blockLineReader, blockReadBuffer, blockStartFP, dictionaryBrowser, dictionaryBrowserSupplier, fieldMetadata, forcedTerm, lineIndexInBlock, postingsReader, scratchBlockBytes, scratchBlockLine, scratchTermState, termState, termStateForced, termStateSerializer, termStatesReadBuffer`

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

      `EMPTY`

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

      `NULL_ACCOUNTABLE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `STMergingBlockReader​(IndexDictionary.BrowserSupplier dictionaryBrowserSupplier, IndexInput blockInput, PostingsReaderBase postingsReader, FieldMetadata fieldMetadata, BlockDecoder blockDecoder, FieldInfos fieldInfos)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `BytesRef` | `next()` |
    `PostingsEnum` | `postings​(String fieldName, BlockTermState termState, PostingsEnum reuse, int flags)` | Creates a new `PostingsEnum` for the provided field and `BlockTermState`.
    `void` | `readFieldTermStatesMap​(Map<String,​BlockTermState> fieldTermStatesMap)` | Reads all the fields `TermState`s of the current term and put them in the provided map.
    `protected BlockTermState` | `readTermStateIfNotRead()` | Reads the `BlockTermState` if it is not already set.
    `TermsEnum.SeekStatus` | `seekCeil​(BytesRef searchedTerm)` |
    `void` | `seekExact​(long ord)` | Not supported.
    `boolean` | `seekExact​(BytesRef searchedTerm)` |
    `void` | `seekExact​(BytesRef term, TermState state)` | Positions this `BlockReader` without re-seeking the term dictionary.

    - ### Methods inherited from class org.apache.lucene.codecs.uniformsplit.sharedterms.STBlockReader

      `createBlockLineSerializer, isBeyondLastTerm, nextTerm, readTermState`

    - ### Methods inherited from class org.apache.lucene.codecs.uniformsplit.BlockReader

      `clearTermState, compareToMiddleAndJump, createBlockHeaderSerializer, createDeltaBaseTermStateSerializer, decodeBlockBytesIfNeeded, docFreq, getOrCreateDictionaryBrowser, impacts, initializeBlockReadLazily, initializeHeader, isCurrentTerm, newCorruptIndexException, ord, postings, ramBytesUsed, readHeader, readLineInBlock, seekInBlock, seekInBlock, term, termState, 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, toString, wait, wait, wait`

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

      `getChildResources`

- - ### Constructor Detail

    - #### STMergingBlockReader

          public STMergingBlockReader​(IndexDictionary.BrowserSupplier dictionaryBrowserSupplier,
                                      IndexInput blockInput,
                                      PostingsReaderBase postingsReader,
                                      FieldMetadata fieldMetadata,
                                      BlockDecoder blockDecoder,
                                      FieldInfos fieldInfos)
                               throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### seekCeil

          public TermsEnum.SeekStatus seekCeil​(BytesRef searchedTerm)

      Overrides:
        `seekCeil` in class `STBlockReader`

    - #### seekExact

          public boolean seekExact​(BytesRef searchedTerm)

      Overrides:
        `seekExact` in class `STBlockReader`

    - #### seekExact

          public void seekExact​(BytesRef term,
                                TermState state)

      Description copied from class: `BlockReader`
      Positions this `BlockReader` without re-seeking the term dictionary.

      The block containing the term is not read by this method. It will be read lazily only if needed, for example if `BlockReader.next()` is called. Calling `BlockReader.postings(org.apache.lucene.index.PostingsEnum, int)` after this method does require the block to be read.

      Overrides:
        `seekExact` in class `BlockReader`

    - #### seekExact

          public void seekExact​(long ord)

      Description copied from class: `BlockReader`
      Not supported.
      Overrides:
        `seekExact` in class `BlockReader`

    - #### readTermStateIfNotRead

          protected BlockTermState readTermStateIfNotRead()

      Description copied from class: `BlockReader`
      Reads the `BlockTermState` if it is not already set. Sets `BlockReader.termState`.
      Overrides:
        `readTermStateIfNotRead` in class `BlockReader`

    - #### next

          public BytesRef next()
                        throws IOException

      Specified by:
        `next` in interface `BytesRefIterator`
      Overrides:
        `next` in class `STBlockReader`
      Throws:
        `IOException`

    - #### postings

          public PostingsEnum postings​(String fieldName,
                                       BlockTermState termState,
                                       PostingsEnum reuse,
                                       int flags)
                                throws IOException

      Creates a new `PostingsEnum` for the provided field and `BlockTermState`.
      Parameters:
        `reuse` - Previous `PostingsEnum` to reuse; or null to create a new one.
        `flags` - Postings flags.
      Throws:
        `IOException`

    - #### readFieldTermStatesMap

          public void readFieldTermStatesMap​(Map<String,​BlockTermState> fieldTermStatesMap)
                                      throws IOException

      Reads all the fields `TermState`s of the current term and put them in the provided map. Clears the map first, before putting `TermState`s.
      Throws:
        `IOException`