Class Category.Builder

java.lang.Object
co.elastic.clients.elasticsearch.ml.Category.Builder
All Implemented Interfaces:
ObjectBuilder<Category>
Enclosing class:
Category

public static class Category.Builder
extends java.lang.Object
implements ObjectBuilder<Category>
Builder for Category.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • categoryId

      public Category.Builder categoryId​(java.lang.Number value)
      Required - A unique identifier for the category. category_id is unique at the job level, even when per-partition categorization is enabled.

      API name: category_id

    • examples

      public Category.Builder examples​(java.util.List<java.lang.String> value)
      Required - A list of examples of actual values that matched the category.

      API name: examples

    • examples

      public Category.Builder examples​(java.lang.String... value)
      Required - A list of examples of actual values that matched the category.

      API name: examples

    • addExamples

      public Category.Builder addExamples​(java.lang.String value)
      Add a value to examples(List), creating the list if needed.
    • grokPattern

      public Category.Builder grokPattern​(@Nullable java.lang.String value)
      [experimental] A Grok pattern that could be used in Logstash or an ingest pipeline to extract fields from messages that match the category. This field is experimental and may be changed or removed in a future release. The Grok patterns that are found are not optimal, but are often a good starting point for manual tweaking.

      API name: grok_pattern

    • jobId

      public Category.Builder jobId​(java.lang.String value)
      Required - Identifier for the anomaly detection job.

      API name: job_id

    • maxMatchingLength

      public Category.Builder maxMatchingLength​(java.lang.Number value)
      Required - The maximum length of the fields that matched the category. The value is increased by 10% to enable matching for similar fields that have not been analyzed.

      API name: max_matching_length

    • partitionFieldName

      public Category.Builder partitionFieldName​(@Nullable java.lang.String value)
      If per-partition categorization is enabled, this property identifies the field used to segment the categorization. It is not present when per-partition categorization is disabled.

      API name: partition_field_name

    • partitionFieldValue

      public Category.Builder partitionFieldValue​(@Nullable java.lang.String value)
      If per-partition categorization is enabled, this property identifies the value of the partition_field_name for the category. It is not present when per-partition categorization is disabled.

      API name: partition_field_value

    • regex

      public Category.Builder regex​(java.lang.String value)
      Required - A regular expression that is used to search for values that match the category.

      API name: regex

    • terms

      public Category.Builder terms​(java.lang.String value)
      Required - A space separated list of the common tokens that are matched in values of the category.

      API name: terms

    • numMatches

      public Category.Builder numMatches​(@Nullable java.lang.Long value)
      The number of messages that have been matched by this category. This is only guaranteed to have the latest accurate count after a job _flush or _close

      API name: num_matches

    • preferredToCategories

      public Category.Builder preferredToCategories​(@Nullable java.util.List<java.lang.String> value)
      A list of category_id entries that this current category encompasses. Any new message that is processed by the categorizer will match against this category and not any of the categories in this list. This is only guaranteed to have the latest accurate list of categories after a job _flush or _close

      API name: preferred_to_categories

    • preferredToCategories

      public Category.Builder preferredToCategories​(java.lang.String... value)
      A list of category_id entries that this current category encompasses. Any new message that is processed by the categorizer will match against this category and not any of the categories in this list. This is only guaranteed to have the latest accurate list of categories after a job _flush or _close

      API name: preferred_to_categories

    • addPreferredToCategories

      public Category.Builder addPreferredToCategories​(java.lang.String value)
      Add a value to preferredToCategories(List), creating the list if needed.
    • p

      public Category.Builder p​(@Nullable java.lang.String value)
      API name: p
    • resultType

      public Category.Builder resultType​(java.lang.String value)
      Required - API name: result_type
    • mlcategory

      public Category.Builder mlcategory​(java.lang.String value)
      Required - API name: mlcategory
    • build

      public Category build()
      Builds a Category.
      Specified by:
      build in interface ObjectBuilder<Category>
      Throws:
      java.lang.NullPointerException - if some of the required fields are null.