Class QueryRuleCriteria.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<QueryRuleCriteria.Builder>
co.elastic.clients.elasticsearch.query_rules.QueryRuleCriteria.Builder
- All Implemented Interfaces:
WithJson<QueryRuleCriteria.Builder>
,ObjectBuilder<QueryRuleCriteria>
- Enclosing class:
- QueryRuleCriteria
public static class QueryRuleCriteria.Builder
extends WithJsonObjectBuilderBase<QueryRuleCriteria.Builder>
implements ObjectBuilder<QueryRuleCriteria>
Builder for
QueryRuleCriteria
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aQueryRuleCriteria
.The metadata field to match against.protected QueryRuleCriteria.Builder
self()
type
(QueryRuleCriteriaType value) Required - The type of criteria.The values to match against themetadata
field.The values to match against themetadata
field.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
type
Required - The type of criteria. The following criteria types are supported:always
: Matches all queries, regardless of input.contains
: Matches that contain this value anywhere in the field meet the criteria defined by the rule. Only applicable for string values.exact
: Only exact matches meet the criteria defined by the rule. Applicable for string or numerical values.fuzzy
: Exact matches or matches within the allowed Levenshtein Edit Distance meet the criteria defined by the rule. Only applicable for string values.gt
: Matches with a value greater than this value meet the criteria defined by the rule. Only applicable for numerical values.gte
: Matches with a value greater than or equal to this value meet the criteria defined by the rule. Only applicable for numerical values.lt
: Matches with a value less than this value meet the criteria defined by the rule. Only applicable for numerical values.lte
: Matches with a value less than or equal to this value meet the criteria defined by the rule. Only applicable for numerical values.prefix
: Matches that start with this value meet the criteria defined by the rule. Only applicable for string values.suffix
: Matches that end with this value meet the criteria defined by the rule. Only applicable for string values.
API name:
type
-
metadata
The metadata field to match against. This metadata will be used to match againstmatch_criteria
sent in the rule. It is required for all criteria types exceptalways
.API name:
metadata
-
values
The values to match against themetadata
field. Only one value must match for the criteria to be met. It is required for all criteria types exceptalways
.API name:
values
Adds all elements of
list
tovalues
. -
values
The values to match against themetadata
field. Only one value must match for the criteria to be met. It is required for all criteria types exceptalways
.API name:
values
Adds one or more values to
values
. -
self
- Specified by:
self
in classWithJsonObjectBuilderBase<QueryRuleCriteria.Builder>
-
build
Builds aQueryRuleCriteria
.- Specified by:
build
in interfaceObjectBuilder<QueryRuleCriteria>
- Throws:
NullPointerException
- if some of the required fields are null.
-