org.hibernate.search.query.engine.spi

## Interface DocumentExtractor

- All Superinterfaces:
    AutoCloseable, Closeable
  All Known Implementing Classes:
    DocumentExtractorImpl

      public interface DocumentExtractor
      extends Closeable

  DocumentExtractor is a traverser over the full-text results (EntityInfo) This operation is as lazy as possible: - the query is executed eagerly - results are not retrieved until actually requested `getFirstIndex()` and `getMaxIndex()` define the boundaries available to `extract(int)`. DocumentExtractor objects *must* be closed when the results are no longer traversed. See `close()`
  Author:
    Emmanuel Bernard

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `EntityInfo` | `extract(int index)` Retrieves entity information for the result at the given index.
    `int` | `getFirstIndex()`
    `int` | `getMaxIndex()`
    `TopDocs` | `getTopDocs()`

- - ### Method Detail

    - #### extract

          EntityInfo extract(int index)
                      throws IOException

      Retrieves entity information for the result at the given index.
      Parameters:
        `index` - The requested result index.
      Returns:
        The entity information for the requested result.
      Throws:
        `IOException` - if an error occurs while extracting the results.

    - #### getFirstIndex

          int getFirstIndex()

    - #### getMaxIndex

          int getMaxIndex()

    - #### close

          void close()

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Closeable`

    - #### getTopDocs

          TopDocs getTopDocs()

      Returns:
        `TopDocs` instance
      Experimental
        We are thinking at ways to encapsulate needs for exposing TopDocs (and whether or not it makes sense) Try to avoid it if you can

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved