public class Query extends Object
Modifier and Type | Class and Description |
---|---|
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 |
Modifier and Type | Field and Description |
---|---|
protected String[] |
_fields |
protected List<io.redisearch.Query.Filter> |
_filters
The query's filter list.
|
protected String[] |
_keys |
protected String |
_language |
protected boolean |
_noContent |
protected boolean |
_noStopwords |
protected Query.Paging |
_paging
The sorting parameters
|
protected byte[] |
_payload |
protected String |
_queryString
The textual part of the query
|
protected String[] |
_returnFields |
protected boolean |
_sortAsc |
protected String |
_sortBy |
protected boolean |
_verbatim |
protected boolean |
_withPayloads |
protected boolean |
_withScores |
protected String[] |
highlightFields |
protected String[] |
highlightTags |
protected String[] |
summarizeFields |
protected int |
summarizeFragmentLen |
protected int |
summarizeNumFragments |
protected String |
summarizeSeparator |
protected boolean |
wantsHighlight |
protected boolean |
wantsSummarize |
Constructor and Description |
---|
Query(String queryString)
Create a new index
|
Modifier and Type | Method and Description |
---|---|
Query |
addFilter(io.redisearch.Query.Filter f)
Add a filter to the query's filter list
|
boolean |
getNoContent() |
boolean |
getWithPayloads() |
boolean |
getWithScores() |
Query |
highlightFields(Query.HighlightTags tags,
String... fields) |
Query |
highlightFields(String... fields) |
Query |
limit(Integer offset,
Integer limit)
Limit the results to a certain offset and limit
|
Query |
limitFields(String... fields)
Limit the query to results that are limited to a specific set of fields
|
Query |
limitKeys(String... keys)
Limit the query to results that are limited to a specific set of keys
|
Query |
returnFields(String... fields)
Result's projection - the fields to return by the query
|
void |
serializeRedisArgs(List<byte[]> args) |
Query |
setLanguage(String language)
Set the query language, for stemming purposes
|
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 |
setPayload(byte[] payload) |
Query |
setSortBy(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 |
setWithPaload()
Deprecated.
|
Query |
setWithPayload()
Set the query to return object payloads, if any were given
|
Query |
setWithScores()
Set the query to return a factored score for each results.
|
Query |
summarizeFields(int contextLen,
int fragmentCount,
String separator,
String... fields) |
Query |
summarizeFields(String... fields) |
protected final List<io.redisearch.Query.Filter> _filters
protected final String _queryString
protected final Query.Paging _paging
protected boolean _verbatim
protected boolean _noContent
protected boolean _noStopwords
protected boolean _withScores
protected boolean _withPayloads
protected String _language
protected String[] _fields
protected String[] _keys
protected String[] _returnFields
protected String[] highlightFields
protected String[] summarizeFields
protected String[] highlightTags
protected String summarizeSeparator
protected int summarizeNumFragments
protected int summarizeFragmentLen
protected byte[] _payload
protected String _sortBy
protected boolean _sortAsc
protected boolean wantsHighlight
protected boolean wantsSummarize
public Query(String queryString)
queryString
- the textual part of the querypublic void serializeRedisArgs(List<byte[]> args)
public Query limit(Integer offset, Integer limit)
offset
- the first result to show, zero based indexinglimit
- how many results we want to showpublic Query addFilter(io.redisearch.Query.Filter f)
f
- either a numeric or geo filter objectpublic Query setPayload(byte[] payload)
public Query setVerbatim()
public boolean getNoContent()
public Query setNoContent()
public Query setNoStopwords()
public boolean getWithScores()
public Query setWithScores()
public boolean getWithPayloads()
@Deprecated public Query setWithPaload()
setWithPayload()
public Query setWithPayload()
public Query setLanguage(String language)
language
- a language. see http://redisearch.io for documentation on languages and stemmingpublic Query limitFields(String... fields)
fields
- a list of TEXT fields in the schemaspublic Query limitKeys(String... keys)
fields
- a list of TEXT fields in the schemaspublic Query returnFields(String... fields)
fields
- a list of TEXT fields in the schemaspublic Query highlightFields(Query.HighlightTags tags, String... fields)
public Query summarizeFields(int contextLen, int fragmentCount, String separator, String... fields)
Copyright © 2019. All rights reserved.