org.hibernate.search.query.engine.impl

## Class QueryHits

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

-     public class QueryHits
      extends Object

  A helper class which gives access to the current query and its hits. This class will dynamically reload the underlying `TopDocs` if required.
  Author:
    Hardy Ferentschik, Sanne Grinovero (C) 2011 Red Hat Inc.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryHits(LazyQueryState searcher, QueryFilters filters, Sort sort, Integer n, TimeoutManagerImpl timeoutManager, Map<FacetingRequest,FacetMetadata> facetingRequestsAndMetadata, Coordinates spatialSearchCenter, String spatialFieldName)`
    `QueryHits(LazyQueryState searcher, QueryFilters filters, Sort sort, TimeoutManagerImpl timeoutManager, Map<FacetingRequest,FacetMetadata> facetingRequestsAndMetadata, Coordinates spatialSearchCenter, String spatialFieldName)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Document` | `doc(int index)`
    `int` | `docId(int index)`
    `Explanation` | `explain(int index)`
    `Map<String,List<Facet>>` | `getFacets()`
    `TopDocs` | `getTopDocs()`
    `int` | `getTotalHits()`
    `float` | `score(int index)`
    `ScoreDoc` | `scoreDoc(int index)`
    `Double` | `spatialDistance(int index)`
    `void` | `visitDocument(int index, StoredFieldVisitor fieldVisitor)` This document loading strategy doesn't return anything as it's the responsibility of the passed StoredFieldVisitor instance to collect the data it needs.

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

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

- - ### Constructor Detail

    - #### QueryHits

          public QueryHits(LazyQueryState searcher,
                           QueryFilters filters,
                           Sort sort,
                           TimeoutManagerImpl timeoutManager,
                           Map<FacetingRequest,FacetMetadata> facetingRequestsAndMetadata,
                           Coordinates spatialSearchCenter,
                           String spatialFieldName)
                    throws IOException

      Throws:
        `IOException`

    - #### QueryHits

          public QueryHits(LazyQueryState searcher,
                           QueryFilters filters,
                           Sort sort,
                           Integer n,
                           TimeoutManagerImpl timeoutManager,
                           Map<FacetingRequest,FacetMetadata> facetingRequestsAndMetadata,
                           Coordinates spatialSearchCenter,
                           String spatialFieldName)
                    throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### doc

          public Document doc(int index)
                       throws IOException

      Throws:
        `IOException`

    - #### visitDocument

          public void visitDocument(int index,
                                    StoredFieldVisitor fieldVisitor)
                             throws IOException

      This document loading strategy doesn't return anything as it's the responsibility of the passed StoredFieldVisitor instance to collect the data it needs.
      Parameters:
        `index` - `ScoreDoc` index
        `fieldVisitor` - accessor to the stored field value in the index
      Throws:
        `IOException` - if an error occurs accessing the index

    - #### scoreDoc

          public ScoreDoc scoreDoc(int index)
                            throws IOException

      Throws:
        `IOException`

    - #### docId

          public int docId(int index)
                    throws IOException

      Throws:
        `IOException`

    - #### score

          public float score(int index)
                      throws IOException

      Throws:
        `IOException`

    - #### spatialDistance

          public Double spatialDistance(int index)
                                 throws IOException

      Throws:
        `IOException`

    - #### explain

          public Explanation explain(int index)
                              throws IOException

      Throws:
        `IOException`

    - #### getTotalHits

          public int getTotalHits()

    - #### getTopDocs

          public TopDocs getTopDocs()

    - #### getFacets

          public Map<String,List<Facet>> getFacets()

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