Class PutRuleRequest
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.query_rules.PutRuleRequest
- All Implemented Interfaces:
JsonpSerializable
Create or update a query rule. Create or update a query rule within a query
ruleset.
IMPORTANT: Due to limitations within pinned queries, you can only pin documents using ids or docs, but cannot use both in single rule. It is advised to use one or the other in query rulesets, to avoid errors. Additionally, pinned queries have a maximum limit of 100 pinned hits. If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<PutRuleRequest>
Json deserializer forPutRuleRequest
static final Endpoint<PutRuleRequest,
PutRuleResponse, ErrorResponse> Endpoint "query_rules.put_rule
". -
Method Summary
Modifier and TypeMethodDescriptionfinal QueryRuleActions
actions()
Required - The actions to take when the rule is matched.final List<QueryRuleCriteria>
criteria()
Required - The criteria that must be met for the rule to be applied.static PutRuleRequest
final Integer
priority()
API name:priority
final String
ruleId()
Required - The unique identifier of the query rule within the specified ruleset to be created or updated.final String
Required - The unique identifier of the query ruleset containing the rule to be created or updated.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
final QueryRuleType
type()
Required - The type of rule.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forPutRuleRequest
-
_ENDPOINT
Endpoint "query_rules.put_rule
".
-
-
Method Details
-
of
-
actions
Required - The actions to take when the rule is matched. The format of this action depends on the rule type.API name:
actions
-
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
-
priority
API name:priority
-
ruleId
Required - The unique identifier of the query rule within the specified ruleset to be created or updated.API name:
rule_id
-
rulesetId
Required - The unique identifier of the query ruleset containing the rule to be created or updated.API name:
ruleset_id
-
type
Required - The type of rule.API name:
type
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupPutRuleRequestDeserializer
protected static void setupPutRuleRequestDeserializer(ObjectDeserializer<PutRuleRequest.Builder> op)
-