org.infinispan.query
Class QueryFactory

java.lang.Object
  extended by org.infinispan.query.QueryFactory

public class QueryFactory
extends Object

Class that is used to build CacheQuery

Since:
4.0
Author:
Navin Surtani

Constructor Summary
QueryFactory(Cache cache, QueryHelper qh)
           
 
Method Summary
 CacheQuery getBasicQuery(String field, String search)
          This method is a basic query.
 CacheQuery getQuery(org.apache.lucene.search.Query luceneQuery)
          This is a simple method that will just return a CacheQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryFactory

public QueryFactory(Cache cache,
                    QueryHelper qh)
Method Detail

getQuery

public CacheQuery getQuery(org.apache.lucene.search.Query luceneQuery)
This is a simple method that will just return a CacheQuery

Parameters:
luceneQuery - - Query
Returns:
the query result

getBasicQuery

public CacheQuery getBasicQuery(String field,
                                String search)
                         throws org.apache.lucene.queryParser.ParseException
This method is a basic query. The user provides 2 strings and internally the Query is built.

The first string is the field that they are searching and the second one is the search that they want to run.

For example: -

CacheQuery cq = new QueryFactory

The query is built by use of a QueryParser and a StandardAnalyzer

Parameters:
field - - the field on the class that you are searching
search - - the String that you want to be using to search
Returns:
CacheQuery result
Throws:
org.apache.lucene.queryParser.ParseException

Google Analytics

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