org.hibernate.search.query.engine.impl

## Class DocumentExtractorImpl

- java.lang.Object
- - org.hibernate.search.query.engine.impl.DocumentExtractorImpl

- All Implemented Interfaces:
    Closeable, AutoCloseable, DocumentExtractor

      public class DocumentExtractorImpl
      extends Object
      implements DocumentExtractor

  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. DocumentExtractor objects *must* be closed when the results are no longer traversed. #close
  Author:
    Emmanuel Bernard, John Griffin, Hardy Ferentschik, Sanne Grinovero (C) 2011 Red Hat Inc.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocumentExtractorImpl(QueryHits queryHits, ExtendedSearchIntegrator extendedIntegrator, String[] projection, Set<String> idFieldNames, boolean allowFieldSelection, LazyQueryState searcher, int firstIndex, int maxIndex, Map<String,EntityIndexBinding> targetedEntityBindings)`

  - ### Method Summary

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

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

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

- - ### Constructor Detail

    - #### DocumentExtractorImpl

          public DocumentExtractorImpl(QueryHits queryHits,
                                       ExtendedSearchIntegrator extendedIntegrator,
                                       String[] projection,
                                       Set<String> idFieldNames,
                                       boolean allowFieldSelection,
                                       LazyQueryState searcher,
                                       int firstIndex,
                                       int maxIndex,
                                       Map<String,EntityIndexBinding> targetedEntityBindings)

  - ### Method Detail

    - #### extract

          public EntityInfo extract(int scoreDocIndex)
                             throws IOException

      Description copied from interface: `DocumentExtractor`
      Retrieves entity information for the result at the given index.
      Specified by:
        `extract` in interface `DocumentExtractor`
      Parameters:
        `scoreDocIndex` - The requested result index.
      Returns:
        The entity information for the requested result.
      Throws:
        `IOException` - if an error occurs while extracting the results.

    - #### getFirstIndex

          public int getFirstIndex()

      Specified by:
        `getFirstIndex` in interface `DocumentExtractor`

    - #### getMaxIndex

          public int getMaxIndex()

      Specified by:
        `getMaxIndex` in interface `DocumentExtractor`

    - #### close

          public void close()

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

    - #### getTopDocs

          public TopDocs getTopDocs()

      Required by Infinispan Query.
      Specified by:
        `getTopDocs` in interface `DocumentExtractor`
      Returns:
        `TopDocs` instance

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