public final class TextQuery<K,V> extends Query<javax.cache.Cache.Entry<K,V>>
QueryTextField
'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 have
Master
degree:
Query<Cache.Entry<Long, Person>> qry = new TextQuery(Person.class, "Master"); // Query all cache nodes. cache.query(qry).getAll();
IgniteCache.query(Query)
,
Serialized FormDFLT_PAGE_SIZE
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
int |
getLimit()
Gets limit to response records count.
|
String |
getText()
Gets text search string.
|
String |
getType()
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, if
0 , 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.
|
String |
toString() |
getPageSize, isLocal, prepare
public TextQuery(String type, String txt)
type
- Type.txt
- Search string.public TextQuery(String type, String txt, int limit)
type
- Type.txt
- Search string.limit
- Limits response records count. If 0 or less, considered to be no limit.public TextQuery(Class<?> type, String txt)
type
- Type.txt
- Search string.public String getType()
public TextQuery<K,V> setType(Class<?> type)
type
- Type.this
For chaining.public TextQuery<K,V> setType(String type)
type
- Type.this
For chaining.public String getText()
public TextQuery<K,V> setText(String txt)
txt
- Text search string.this
For chaining.public int getLimit()
public TextQuery<K,V> setLimit(int limit)
limit
- If 0 or less, considered to be no limit.this
For chaining.public TextQuery<K,V> setPageSize(int pageSize)
0
, then default is used.setPageSize
in class Query<javax.cache.Cache.Entry<K,V>>
pageSize
- Optional page size.this
for chaining.public TextQuery<K,V> setLocal(boolean loc)
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023