Class QueryRule.AbstractBuilder<BuilderT extends QueryRule.AbstractBuilder<BuilderT>>
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch.query_rules.QueryRule.AbstractBuilder<BuilderT>
- All Implemented Interfaces:
WithJson<BuilderT>
- Direct Known Subclasses:
GetRuleResponse.Builder
,QueryRule.Builder
- Enclosing class:
- QueryRule
public abstract static class QueryRule.AbstractBuilder<BuilderT extends QueryRule.AbstractBuilder<BuilderT>>
extends WithJsonObjectBuilderBase<BuilderT>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal BuilderT
actions
(QueryRuleActions value) Required - The actions to take when the rule is matched.final BuilderT
Required - The actions to take when the rule is matched.final BuilderT
criteria
(QueryRuleCriteria value, QueryRuleCriteria... values) Required - The criteria that must be met for the rule to be applied.final BuilderT
Required - The criteria that must be met for the rule to be applied.final BuilderT
criteria
(List<QueryRuleCriteria> list) Required - The criteria that must be met for the rule to be applied.final BuilderT
API name:priority
final BuilderT
Required - A unique identifier for the rule.protected abstract BuilderT
self()
final BuilderT
type
(QueryRuleType value) Required - The type of rule.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
-
AbstractBuilder
public AbstractBuilder()
-
-
Method Details
-
ruleId
Required - A unique identifier for the rule.API name:
rule_id
-
type
Required - The type of rule.pinned
will identify and pin specific documents to the top of search results.exclude
will exclude specific documents from search results.API name:
type
-
criteria
Required - The criteria that must be met for the rule to be applied. If multiple criteria are specified for a rule, all criteria must be met for the rule to be applied.API name:
criteria
Adds all elements of
list
tocriteria
. -
criteria
Required - The criteria that must be met for the rule to be applied. If multiple criteria are specified for a rule, all criteria must be met for the rule to be applied.API name:
criteria
Adds one or more values to
criteria
. -
criteria
public final BuilderT criteria(Function<QueryRuleCriteria.Builder, ObjectBuilder<QueryRuleCriteria>> fn) Required - The criteria that must be met for the rule to be applied. If multiple criteria are specified for a rule, all criteria must be met for the rule to be applied.API name:
criteria
Adds a value to
criteria
using a builder lambda. -
actions
Required - The actions to take when the rule is matched. The format of this action depends on the rule type.API name:
actions
-
actions
public final BuilderT actions(Function<QueryRuleActions.Builder, ObjectBuilder<QueryRuleActions>> fn) Required - The actions to take when the rule is matched. The format of this action depends on the rule type.API name:
actions
-
priority
API name:priority
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<BuilderT extends QueryRule.AbstractBuilder<BuilderT>>
-