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 Details

    • AbstractBuilder

      public AbstractBuilder()
  • Method Details

    • ruleId

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

      API name: rule_id

    • type

      public final BuilderT type(QueryRuleType value)
      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 BuilderT criteria(List<QueryRuleCriteria> list)
      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 to criteria.

    • criteria

      public final BuilderT criteria(QueryRuleCriteria value, QueryRuleCriteria... values)
      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

      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

      public final BuilderT actions(QueryRuleActions value)
      Required - The actions to take when the rule is matched. The format of this action depends on the rule type.

      API name: actions

    • 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

      public final BuilderT priority(@Nullable Integer value)
      API name: priority
    • self

      protected abstract BuilderT self()
      Specified by:
      self in class WithJsonObjectBuilderBase<BuilderT extends QueryRule.AbstractBuilder<BuilderT>>