Modifier and Type | Class and Description |
---|---|
static class |
Query.Filter
Filter represents a filtering rules in a query
|
static class |
Query.GeoFilter
GeoFilter encapsulates a radius filter on a geographical indexed fields
|
static class |
Query.HighlightTags |
static class |
Query.NumericFilter
NumericFilter wraps a range filter on a numeric field.
|
static class |
Query.Paging |
Constructor and Description |
---|
Query() |
Query(java.lang.String queryString)
Create a new index
|
Modifier and Type | Method and Description |
---|---|
Query |
addFilter(Query.Filter f)
Add a filter to the query's filter list
|
Query |
addParam(java.lang.String name,
java.lang.Object value)
Parameters can be referenced in the query string by a $ , followed by the parameter name,
e.g., $user , and each such reference in the search query to a parameter name is substituted
by the corresponding parameter value.
|
void |
addParams(CommandArguments args) |
Query |
dialect(int dialect)
Set the dialect version to execute the query accordingly
|
Query |
dialectOptional(int dialect)
This method will not replace the dialect if it has been already set.
|
boolean |
getNoContent() |
boolean |
getWithScores() |
Query |
highlightFields(Query.HighlightTags tags,
java.lang.String... fields) |
Query |
highlightFields(java.lang.String... fields) |
Query |
limit(java.lang.Integer offset,
java.lang.Integer limit)
Limit the results to a certain offset and limit
|
Query |
limitFields(java.lang.String... fields)
Limit the query to results that are limited to a specific set of fields
|
Query |
limitKeys(java.lang.String... keys)
Limit the query to results that are limited to a specific set of keys
|
Query |
returnFields(FieldName... fields)
Result's projection - the fields to return by the query
|
Query |
returnFields(java.lang.String... fields)
Result's projection - the fields to return by the query
|
Query |
setExpander(java.lang.String field)
Set the query to use a custom query expander instead of the stemmer
|
Query |
setInOrder()
Set the query terms appear in the same order in the document as in the query, regardless of the offsets between them
|
Query |
setLanguage(java.lang.String language)
Set the query language, for stemming purposes
See http://redisearch.io for documentation on languages and stemming
|
Query |
setNoContent()
Set the query not to return the contents of documents, and rather just return the ids
|
Query |
setNoStopwords()
Set the query not to filter for stopwords.
|
Query |
setScorer(java.lang.String scorer)
Set the query custom scorer
See http://redisearch.io for documentation on extending RediSearch
|
Query |
setSortBy(java.lang.String field,
boolean ascending)
Set the query to be sorted by a Sortable field defined in the schema
|
Query |
setVerbatim()
Set the query to verbatim mode, disabling stemming and query expansion
|
Query |
setWithScores()
Set the query to return a factored score for each results.
|
Query |
slop(int slop)
Set the slop to execute the query accordingly
|
Query |
summarizeFields(int contextLen,
int fragmentCount,
java.lang.String separator,
java.lang.String... fields) |
Query |
summarizeFields(java.lang.String... fields) |
Query |
timeout(long timeout)
Set the timeout to execute the query accordingly
|
public Query()
public Query(java.lang.String queryString)
queryString
- the textual part of the querypublic void addParams(CommandArguments args)
public Query limit(java.lang.Integer offset, java.lang.Integer limit)
offset
- the first result to show, zero based indexinglimit
- how many results we want to showpublic Query addFilter(Query.Filter f)
f
- either a numeric or geo filter objectpublic Query setVerbatim()
public boolean getNoContent()
public Query setNoContent()
public Query setNoStopwords()
public boolean getWithScores()
public Query setWithScores()
public Query setLanguage(java.lang.String language)
See http://redisearch.io for documentation on languages and stemming
language
- a language.public Query setScorer(java.lang.String scorer)
See http://redisearch.io for documentation on extending RediSearch
scorer
- a custom scorer.public Query limitFields(java.lang.String... fields)
fields
- a list of TEXT fields in the schemaspublic Query limitKeys(java.lang.String... keys)
keys
- a list of TEXT fields in the schemaspublic Query returnFields(java.lang.String... fields)
fields
- a list of TEXT fields in the schemaspublic Query returnFields(FieldName... fields)
fields
- a list of TEXT fields in the schemaspublic Query highlightFields(Query.HighlightTags tags, java.lang.String... fields)
public Query highlightFields(java.lang.String... fields)
public Query summarizeFields(int contextLen, int fragmentCount, java.lang.String separator, java.lang.String... fields)
public Query summarizeFields(java.lang.String... fields)
public Query setSortBy(java.lang.String field, boolean ascending)
field
- the sorting field's nameascending
- if set to true, the sorting order is ascending, else descendingpublic Query addParam(java.lang.String name, java.lang.Object value)
name
- value
- can be String, long or floatpublic Query dialect(int dialect)
dialect
- integerpublic Query dialectOptional(int dialect)
dialect
- dialectpublic Query slop(int slop)
slop
- integerpublic Query timeout(long timeout)
timeout
- longpublic Query setInOrder()
public Query setExpander(java.lang.String field)
field
- the expander field's nameCopyright © 2024. All rights reserved.