java.lang.Object
co.elastic.clients.elasticsearch.query_rules.QueryRule
All Implemented Interfaces:
JsonpSerializable
Direct Known Subclasses:
GetRuleResponse

@JsonpDeserializable public class QueryRule extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • queryRuleOf

      public static QueryRule queryRuleOf(Function<QueryRule.Builder,ObjectBuilder<QueryRule>> fn)
    • ruleId

      public final String ruleId()
      Required - A unique identifier for the rule.

      API name: rule_id

    • type

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

      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

    • 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

    • priority

      @Nullable public final Integer priority()
      API name: priority
    • 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)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setupQueryRuleDeserializer

      protected static <BuilderT extends QueryRule.AbstractBuilder<BuilderT>> void setupQueryRuleDeserializer(ObjectDeserializer<BuilderT> op)