Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.cache.search
Interface CacheQuery

All Superinterfaces:
  Iterable

All Known Implementing Classes:
  CacheQueryImpl

    public interface CacheQuery

extends Iterable

A cache-query is what will be returned when the createQuery() method is run. This object can have methods such as list, setFirstResult,setMaxResults, setFetchSize, getResultSize and setSort.

Author:
  Manik Surtani (manik@jboss.org), Navin Surtani (nsurtani@redhat.com)
See Also:
  `org.jboss.cache.search.SearchableCache#createQuery(org.apache.lucene.search.Query)`

Method Summary
`void` | `disableFullTextFilter(String name)` Disable a given filter by its name.
`org.hibernate.search.FullTextFilter` | `enableFullTextFilter(String name)` Enable a given filter by its name.
`int` | `getResultSize()` Gets the integer number of results.
`QueryResultIterator` | `iterator()` Returns the results of a search as a `QueryResultIterator`.
`QueryResultIterator` | `iterator(int fetchSize)` Returns the results of a search as a `QueryResultIterator` with a given integer parameter - the fetchSize.
`QueryResultIterator` | `lazyIterator()` Calls the `lazyIterator(int fetchSize)` method but passes in a default 1 as a parameter.
`QueryResultIterator` | `lazyIterator(int fetchSize)` Lazily loads the results from the Query as a `QueryResultIterator` with a given integer parameter - the fetchSize.
`List<Object>` | `list()` Returns the results of a search as a list.
`void` | `setFilter(org.apache.lucene.search.Filter f)` Allows lucene to filter the results.
`void` | `setFirstResult(int index)` Sets a result with a given index to the first result.
`void` | `setMaxResults(int numResults)` Sets the maximum number of results to the number passed in as a parameter.
`void` | `setSort(org.apache.lucene.search.Sort s)` Allows lucene to sort the results.

Method Detail

### list

    List<Object> list()

  Returns the results of a search as a list.

  Returns:
    list of objects that were found from the search.

### iterator

    QueryResultIterator iterator(int fetchSize)

  Returns the results of a search as a `QueryResultIterator` with a given integer parameter - the fetchSize.

  Parameters:
    `fetchSize` - integer to be given to the implementation constructor.
  Returns:
    a QueryResultIterator which can be used to iterate through the results that were found.

### iterator

    QueryResultIterator iterator()

  Returns the results of a search as a `QueryResultIterator`. This calls `iterator(int fetchSize)` but uses a default fetchSize of 1.

  Specified by:
    `iterator` in interface `Iterable`
  Returns:
    a QueryResultIterator which can be used to iterate through the results that were found.

### lazyIterator

    QueryResultIterator lazyIterator(int fetchSize)

  Lazily loads the results from the Query as a `QueryResultIterator` with a given integer parameter - the fetchSize.

  Parameters:
    `fetchSize` - integer to be passed into the lazy implementation of `QueryResultIterator`
  Returns:
    a QueryResultIterator which can be used to lazily iterate through results.

### lazyIterator

    QueryResultIterator lazyIterator()

  Calls the `lazyIterator(int fetchSize)` method but passes in a default 1 as a parameter.

  Returns:
    a QueryResultIterator which can be used to lazily iterate through results.

### setFirstResult

    void setFirstResult(int index)

  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.

### setMaxResults

    void setMaxResults(int numResults)

  Sets the maximum number of results to the number passed in as a parameter.

  Parameters:
    `numResults` - that are to be set to the maxResults.

### getResultSize

    int getResultSize()

  Gets the integer number of results.

  Returns:
    integer number of results.

### setSort

    void setSort(org.apache.lucene.search.Sort s)

  Allows lucene to sort the results. Integers are sorted in descending order.

  Parameters:
    `s` - - lucene sort object

### enableFullTextFilter

    org.hibernate.search.FullTextFilter enableFullTextFilter(String name)

  Enable a given filter by its name.

  Parameters:
    `name` - of filter.
  Returns:
    a FullTextFilter object.

### disableFullTextFilter

    void disableFullTextFilter(String name)

  Disable a given filter by its name.

  Parameters:
    `name` - of filter.

### setFilter

    void setFilter(org.apache.lucene.search.Filter f)

  Allows lucene to filter the results.

  Parameters:
    `f` - - lucene filter

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.