Package org.apache.ignite.cache.query
Class TextQuery<K,V>
- java.lang.Object
- 
- org.apache.ignite.cache.query.Query<javax.cache.Cache.Entry<K,V>>
- 
- org.apache.ignite.cache.query.TextQuery<K,V>
 
 
- 
- All Implemented Interfaces:
- Serializable
 
 public final class TextQuery<K,V> extends Query<javax.cache.Cache.Entry<K,V>> Full Text QueriesIgnite supports full text queries based on Apache Lucene engine. Note that all fields that are expected to show up in text query results must be annotated withQueryTextFieldQuery usageIgnite TextQuery supports classic Lucene query syntax. See Lucene classic MultiFieldQueryParser and StandardAnalyzer javadoc for details. As an example, suppose we have data model consisting of'Employee'class defined as follows:public class Person { private long id; private String name; // Index for text search. @QueryTextField private String resume; ... }Here is a possible query that will use Lucene text search to scan all resumes to check if employees haveMasterdegree:Query<Cache.Entry<Long, Person>> qry = new TextQuery(Person.class, "Master"); // Query all cache nodes. cache.query(qry).getAll();- See Also:
- IgniteCache.query(Query), Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.ignite.cache.query.QueryDFLT_PAGE_SIZE
 
- 
 - 
Constructor SummaryConstructors Constructor Description TextQuery(Class<?> type, String txt)Constructs query for the given search string.TextQuery(Class<?> type, String txt, int limit)Constructs query for the given search string.TextQuery(String type, String txt)Constructs query for the given search string.TextQuery(String type, String txt, int limit)Constructs query for the given search string.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetLimit()Gets limit to response records count.StringgetText()Gets text search string.StringgetType()Gets type for query.TextQuery<K,V>setLimit(int limit)Sets limit to response records count.TextQuery<K,V>setLocal(boolean loc)Sets whether this query should be executed on local node only.TextQuery<K,V>setPageSize(int pageSize)Sets optional page size, if0, then default is used.TextQuery<K,V>setText(String txt)Sets text search string.TextQuery<K,V>setType(Class<?> type)Sets type for query.TextQuery<K,V>setType(String type)Sets type for query.StringtoString()- 
Methods inherited from class org.apache.ignite.cache.query.QuerygetPageSize, isLocal, prepare
 
- 
 
- 
- 
- 
Constructor Detail- 
TextQuerypublic TextQuery(String type, String txt) Constructs query for the given search string.- Parameters:
- type- Type.
- txt- Search string.
 
 - 
TextQuerypublic TextQuery(String type, String txt, int limit) Constructs query for the given search string.- Parameters:
- type- Type.
- txt- Search string.
- limit- Limits response records count. If 0 or less, considered to be no limit.
 
 - 
TextQuerypublic TextQuery(Class<?> type, String txt) Constructs query for the given search string.- Parameters:
- type- Type.
- txt- Search string.
 
 
- 
 - 
Method Detail- 
getTypepublic String getType() Gets type for query.- Returns:
- Type.
 
 - 
setTypepublic TextQuery<K,V> setType(Class<?> type) Sets type for query.- Parameters:
- type- Type.
- Returns:
- thisFor chaining.
 
 - 
setTypepublic TextQuery<K,V> setType(String type) Sets type for query.- Parameters:
- type- Type.
- Returns:
- thisFor chaining.
 
 - 
getTextpublic String getText() Gets text search string.- Returns:
- Text search string.
 
 - 
setTextpublic TextQuery<K,V> setText(String txt) Sets text search string.- Parameters:
- txt- Text search string.
- Returns:
- thisFor chaining.
 
 - 
getLimitpublic int getLimit() Gets limit to response records count.- Returns:
- Limit value.
 
 - 
setLimitpublic TextQuery<K,V> setLimit(int limit) Sets limit to response records count.- Parameters:
- limit- If 0 or less, considered to be no limit.
- Returns:
- thisFor chaining.
 
 - 
setPageSizepublic TextQuery<K,V> setPageSize(int pageSize) Sets optional page size, if0, then default is used.- Overrides:
- setPageSizein class- Query<javax.cache.Cache.Entry<K,V>>
- Parameters:
- pageSize- Optional page size.
- Returns:
- thisfor chaining.
 
 - 
setLocalpublic TextQuery<K,V> setLocal(boolean loc) Sets whether this query should be executed on local node only.
 
- 
 
-