Interface CacheQuery<E>

  • All Superinterfaces:
    Iterable<E>

    @Deprecated
    public interface CacheQuery<E>
    extends Iterable<E>
    Deprecated.
    Since 11.0, replaced by Query in the Query API and IndexedQuery internally.
    A cache-query is what will be returned when the getQuery() method is run on SearchManagerImpl. This object can have methods such as list, setFirstResult,setMaxResults, setFetchSize, getResultSize and setSort.

    Author:
    Manik Surtani, Navin Surtani, Sanne Grinovero <sanne@hibernate.org> (C) 2011 Red Hat Inc., Marko Luksa
    See Also:
    SearchManagerImpl.getQuery(String)
    • Method Detail

      • list

        List<E> list()
        Deprecated.
        Returns the results of a search as a list.
        Returns:
        list of objects that were found from the search.
      • iterator

        ResultIterator<E> iterator​(FetchOptions fetchOptions)
        Deprecated.
        Returns the results of a search as a ResultIterator. Warning: the return type is an extension of Iterator which introduces a CloseableIterator.close() method. This close method needs to be invoked when the iteration is complete to avoid resource leakage.
        Parameters:
        fetchOptions - how to fetch results (see @link FetchOptions)
        Returns:
        a QueryResultIterator which can be used to iterate through the results that were found.
      • firstResult

        CacheQuery<E> firstResult​(int index)
        Deprecated.
        Sets a result with a given index to the first result.
        Parameters:
        index - of result to be set to the first.
        Throws:
        IllegalArgumentException - if the index given is less than zero.
      • maxResults

        CacheQuery<E> maxResults​(int numResults)
        Deprecated.
        Sets the maximum number of results to the number passed in as a parameter.
        Parameters:
        numResults - that are to be set to the maxResults.
      • getFacetManager

        org.hibernate.search.query.engine.spi.FacetManager getFacetManager()
        Deprecated.
        Returns:
        return the manager for all faceting related operations
      • getResultSize

        int getResultSize()
        Deprecated.
        Gets the total number of results matching the query, ignoring pagination (firstResult, maxResult).
        Returns:
        total number of results.
      • explain

        org.apache.lucene.search.Explanation explain​(int documentId)
        Deprecated.
        Return the Lucene Explanation object describing the score computation for the matching object/document in the current query
        Parameters:
        documentId - Lucene Document id to be explain. This is NOT the object key
        Returns:
        Lucene Explanation
      • sort

        CacheQuery<E> sort​(org.apache.lucene.search.Sort s)
        Deprecated.
        Allows lucene to sort the results. Integers are sorted in descending order.
        Parameters:
        s - - lucene sort object
      • projection

        CacheQuery<Object[]> projection​(String... fields)
        Deprecated.
        Defines the Lucene field names projected and returned in a query result Each field is converted back to it's object representation, an Object[] being returned for each "row"

        A projectable field must be stored in the Lucene index and use a TwoWayFieldBridge Unless notified in their JavaDoc, all built-in bridges are two-way. All @DocumentId fields are projectable by design.

        If the projected field is not a projectable field, null is returned in the object[]

        Parameters:
        fields - the projected field names
        Returns:
        this to allow for method chaining, but the type parameter now becomes Object[]
      • enableFullTextFilter

        org.hibernate.search.filter.FullTextFilter enableFullTextFilter​(String name)
        Deprecated.
        Enable a given filter by its name.
        Parameters:
        name - of filter.
        Returns:
        a FullTextFilter object.
      • disableFullTextFilter

        CacheQuery<E> disableFullTextFilter​(String name)
        Deprecated.
        Disable a given filter by its name.
        Parameters:
        name - of filter.
      • filter

        CacheQuery<E> filter​(org.apache.lucene.search.Filter f)
        Deprecated.
        Allows lucene to filter the results.
        Parameters:
        f - - lucene filter
      • timeout

        CacheQuery<E> timeout​(long timeout,
                              TimeUnit timeUnit)
        Deprecated.
        Set the timeout for this query. If the query hasn't finished processing before the timeout, an exception will be thrown.
        Parameters:
        timeout - the timeout duration
        timeUnit - the time unit of the timeout parameter
        Returns: