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
Class CacheQueryImpl

    java.lang.Object
      org.jboss.cache.search.CacheQueryImpl

All Implemented Interfaces:
  Iterable, CacheQuery

    public class CacheQueryImpl

extends Object
implements CacheQuery

Implementation class of the CacheQuery interface.

Author:
  Navin Surtani (nsurtani@redhat.com)

Constructor Summary
`CacheQueryImpl(org.apache.lucene.search.Query luceneQuery, org.hibernate.search.engine.SearchFactoryImplementor searchFactory, org.jboss.cache.Cache cache)`
`CacheQueryImpl(org.apache.lucene.search.Query luceneQuery, org.hibernate.search.engine.SearchFactoryImplementor searchFactory, org.jboss.cache.Cache cache, Class... classes)`

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 `CacheQuery.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)` Takes in a lucene filter and sets it to the filter field in the class.
`void` | `setFirstResult(int firstResult)` Sets the the result of the given integer value to the first result.
`void` | `setMaxResults(int maxResults)` 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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CacheQueryImpl

    public CacheQueryImpl(org.apache.lucene.search.Query luceneQuery,
                          org.hibernate.search.engine.SearchFactoryImplementor searchFactory,
                          org.jboss.cache.Cache cache)

### CacheQueryImpl

    public CacheQueryImpl(org.apache.lucene.search.Query luceneQuery,
                          org.hibernate.search.engine.SearchFactoryImplementor searchFactory,
                          org.jboss.cache.Cache cache,
                          Class... classes)

Method Detail

### setFilter

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

  Takes in a lucene filter and sets it to the filter field in the class.

  Specified by:
    `setFilter` in interface `CacheQuery`
  Parameters:
    `f` - - lucene filter

### getResultSize

    public int getResultSize()

  Description copied from interface: `CacheQuery`
  Gets the integer number of results.

  Specified by:
    `getResultSize` in interface `CacheQuery`
  Returns:
    The result size of the query.

### setSort

    public void setSort(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:
    `setSort` in interface `CacheQuery`
  Parameters:
    `s` - - lucene sort object

### enableFullTextFilter

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

  Enable a given filter by its name.

  Specified by:
    `enableFullTextFilter` in interface `CacheQuery`
  Parameters:
    `name` - of filter.
  Returns:
    a FullTextFilter object.

### disableFullTextFilter

    public void disableFullTextFilter(String name)

  Disable a given filter by its name.

  Specified by:
    `disableFullTextFilter` in interface `CacheQuery`
  Parameters:
    `name` - of filter.

### setFirstResult

    public void setFirstResult(int firstResult)

  Sets the the result of the given integer value to the first result.

  Specified by:
    `setFirstResult` in interface `CacheQuery`
  Parameters:
    `firstResult` - index to be set.
  Throws:
    `IllegalArgumentException` - if the index given is less than zero.

### iterator

    public QueryResultIterator iterator()
                                 throws org.hibernate.HibernateException

  Description copied from interface: `CacheQuery`
  Returns the results of a search as a `QueryResultIterator`. This calls `CacheQuery.iterator(int fetchSize)` but uses a default fetchSize of 1.

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

### iterator

    public QueryResultIterator iterator(int fetchSize)
                                 throws org.hibernate.HibernateException

  Description copied from interface: `CacheQuery`
  Returns the results of a search as a `QueryResultIterator` with a given integer parameter - the fetchSize.

  Specified by:
    `iterator` in interface `CacheQuery`
  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.
  Throws:
    `org.hibernate.HibernateException`

### lazyIterator

    public QueryResultIterator lazyIterator()

  Description copied from interface: `CacheQuery`
  Calls the `CacheQuery.lazyIterator(int fetchSize)` method but passes in a default 1 as a parameter.

  Specified by:
    `lazyIterator` in interface `CacheQuery`
  Returns:
    a QueryResultIterator which can be used to lazily iterate through results.

### lazyIterator

    public QueryResultIterator lazyIterator(int fetchSize)

  Description copied from interface: `CacheQuery`
  Lazily loads the results from the Query as a `QueryResultIterator` with a given integer parameter - the fetchSize.

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

### list

    public List<Object> list()
                      throws org.hibernate.HibernateException

  Description copied from interface: `CacheQuery`
  Returns the results of a search as a list.

  Specified by:
    `list` in interface `CacheQuery`
  Returns:
    list of objects that were found from the search.
  Throws:
    `org.hibernate.HibernateException`

### setMaxResults

    public void setMaxResults(int maxResults)

  Description copied from interface: `CacheQuery`
  Sets the maximum number of results to the number passed in as a parameter.

  Specified by:
    `setMaxResults` in interface `CacheQuery`
  Parameters:
    `maxResults` - that are to be set to the maxResults.

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

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