Class PutRuleRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.query_rules.PutRuleRequest
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class PutRuleRequest extends RequestBase implements 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:
  • Field Details

  • Method Details

    • of

    • actions

      public final QueryRuleActions 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

      public final List<QueryRuleCriteria> 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

      @Nullable public final Integer priority()
      API name: priority
    • ruleId

      public final String ruleId()
      Required - The unique identifier of the query rule within the specified ruleset to be created or updated.

      API name: rule_id

    • rulesetId

      public final String rulesetId()
      Required - The unique identifier of the query ruleset containing the rule to be created or updated.

      API name: ruleset_id

    • type

      public final QueryRuleType type()
      Required - The type of rule.

      API name: type

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • setupPutRuleRequestDeserializer

      protected static void setupPutRuleRequestDeserializer(ObjectDeserializer<PutRuleRequest.Builder> op)