Interface IndexedQuery<E>

    • Method Detail

      • sort

        IndexedQuery<E> sort​(org.apache.lucene.search.Sort s)
        Description copied from interface: CacheQuery
        Allows lucene to sort the results. Integers are sorted in descending order.
        Specified by:
        sort in interface CacheQuery<E>
        Parameters:
        s - - lucene sort object
      • projection

        IndexedQuery<Object[]> projection​(String... fields)
        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[]

        Specified by:
        projection in interface CacheQuery<E>
        Parameters:
        fields - the projected field names
        Returns:
        this to allow for method chaining, but the type parameter now becomes Object[]
      • list

        List<E> list()
        Description copied from interface: CacheQuery
        Returns the results of a search as a list.
        Specified by:
        list in interface CacheQuery<E>
        Returns:
        the results of a search as a list.
      • firstResult

        IndexedQuery<E> firstResult​(int index)
        Sets the index of the first result, skipping the previous ones. Used for pagination.
        Specified by:
        firstResult in interface CacheQuery<E>
        Parameters:
        index - of the first result
        Throws:
        IllegalArgumentException - if the index given is less than zero.
      • maxResults

        IndexedQuery<E> maxResults​(int numResults)
        Sets the maximum number of results to return from the query. Used for pagination.
        Specified by:
        maxResults in interface CacheQuery<E>
        Parameters:
        numResults - the maximum number of results to return.
      • timeout

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