Package redis.clients.jedis.search
Class FTSearchParams
java.lang.Object
redis.clients.jedis.search.FTSearchParams
- All Implemented Interfaces:
IParams
Query represents query parameters and filters to load results from the engine
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGeoFilter encapsulates a radius filter on a geographical indexed fieldsstatic classstatic classNumericFilter wraps a range filter on a numeric field.static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Integerprivate Stringprivate booleanprivate FTSearchParams.HighlightParamsprivate Collection<String> private Collection<String> private booleanprivate Stringprivate int[]private booleanprivate booleanprivate Collection<FieldName> private Collection<String> private Stringprivate Integerprivate Stringprivate SortingOrderprivate booleanprivate FTSearchParams.SummarizeParamsprivate Longprivate booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionParameters 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.voidaddParams(CommandArguments args) dialect(int dialect) Set the dialect version to execute the query accordinglyfilter(FTSearchParams.NumericFilter numericFilter) geoFilter(FTSearchParams.GeoFilter geoFilter) booleanbooleanhighlight(FTSearchParams.HighlightParams highlightParams) Limit the query to results that are limited to a specific set of fieldsinFields(Collection<String> fields) private voidLimit the query to results that are limited to a specific set of keysinKeys(Collection<String> keys) inOrder()Set the query language, for stemming purposeslimit(int offset, int num) Limit the results to a certain offset and limitSet the query not to return the contents of documents, and rather just return the idsSet the query not to filter for stopwords.returnField(FieldName field) returnFields(String... fields) Result's projection - the fields to return by the queryreturnFields(Collection<FieldName> fields) returnFields(FieldName... fields) Set the query custom scorerstatic FTSearchParamsslop(int slop) sortBy(String sortBy, SortingOrder order) Set the query to be sorted by a Sortable field defined in the schemasummarize(FTSearchParams.SummarizeParams summarizeParams) timeout(long timeout) verbatim()Set the query to verbatim mode, disabling stemming and query expansionSet the query to return a factored score for each results.
-
Field Details
-
noContent
private boolean noContent -
verbatim
private boolean verbatim -
noStopwords
private boolean noStopwords -
withScores
private boolean withScores -
filters
-
inKeys
-
inFields
-
returnFields
-
returnFieldNames
-
summarize
private boolean summarize -
summarizeParams
-
highlight
private boolean highlight -
highlightParams
-
slop
-
timeout
-
inOrder
private boolean inOrder -
language
-
expander
-
scorer
-
sortBy
-
sortOrder
-
limit
private int[] limit -
params
-
dialect
-
-
Constructor Details
-
FTSearchParams
public FTSearchParams()
-
-
Method Details
-
searchParams
-
addParams
-
noContent
Set the query not to return the contents of documents, and rather just return the ids- Returns:
- the query itself
-
verbatim
Set the query to verbatim mode, disabling stemming and query expansion- Returns:
- the query object
-
noStopwords
Set the query not to filter for stopwords. In general this should not be used- Returns:
- the query object
-
withScores
Set the query to return a factored score for each results. This is useful to merge results from multiple queries.- Returns:
- the query object itself
-
filter
-
filter
public FTSearchParams filter(String field, double min, boolean exclusiveMin, double max, boolean exclusiveMax) -
filter
-
geoFilter
-
geoFilter
-
inKeys
Limit the query to results that are limited to a specific set of keys- Parameters:
keys- a list of TEXT fields in the schemas- Returns:
- the query object itself
-
inKeys
-
inFields
Limit the query to results that are limited to a specific set of fields- Parameters:
fields- a list of TEXT fields in the schemas- Returns:
- the query object itself
-
inFields
-
returnFields
Result's projection - the fields to return by the query- Parameters:
fields- a list of TEXT fields in the schemas- Returns:
- the query object itself
-
returnField
-
returnFields
-
returnFields
-
initReturnFieldNames
private void initReturnFieldNames() -
summarize
-
summarize
-
highlight
-
highlight
-
scorer
Set the query custom scorerSee http://redisearch.io for documentation on extending RediSearch
- Parameters:
scorer- a custom scorer.- Returns:
- the query object itself
-
slop
-
timeout
-
inOrder
-
language
Set the query language, for stemming purposesSee http://redisearch.io for documentation on languages and stemming
- Parameters:
language- a language.- Returns:
- the query object itself
-
sortBy
Set the query to be sorted by a Sortable field defined in the schema- Parameters:
sortBy- the sorting field's nameorder- the sorting order- Returns:
- the query object itself
-
limit
Limit the results to a certain offset and limit- Parameters:
offset- the first result to show, zero based indexingnum- how many results we want to show- Returns:
- the query itself, for builder-style syntax
-
addParam
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.- Parameters:
name-value- can be String, long or float- Returns:
- the query object itself
-
params
-
dialect
Set the dialect version to execute the query accordingly- Parameters:
dialect- integer- Returns:
- the query object itself
-
getNoContent
public boolean getNoContent() -
getWithScores
public boolean getWithScores() -
summarizeParams
-
highlightParams
-