java.lang.Object
org.elasticsearch.xpack.core.ml.job.config.AnalysisConfig
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class AnalysisConfig extends Object implements org.elasticsearch.xcontent.ToXContentObject, Writeable
Autodetect analysis configuration options describes which fields are analysed and the functions to use.

The configuration can contain multiple detectors, a new anomaly detector will be created for each detector configuration. The fields bucketSpan, modelPruneWindow, summaryCountFieldName and categorizationFieldName apply to all detectors.

If a value has not been set it will be null Object wrappers are used around integral types & booleans so they can take null values.

  • Field Details

    • ANALYSIS_CONFIG

      public static final org.elasticsearch.xcontent.ParseField ANALYSIS_CONFIG
      Serialisation names
    • BUCKET_SPAN

      public static final org.elasticsearch.xcontent.ParseField BUCKET_SPAN
    • MODEL_PRUNE_WINDOW

      public static final org.elasticsearch.xcontent.ParseField MODEL_PRUNE_WINDOW
    • CATEGORIZATION_FIELD_NAME

      public static final org.elasticsearch.xcontent.ParseField CATEGORIZATION_FIELD_NAME
    • CATEGORIZATION_FILTERS

      public static final org.elasticsearch.xcontent.ParseField CATEGORIZATION_FILTERS
    • CATEGORIZATION_ANALYZER

      public static final org.elasticsearch.xcontent.ParseField CATEGORIZATION_ANALYZER
    • PER_PARTITION_CATEGORIZATION

      public static final org.elasticsearch.xcontent.ParseField PER_PARTITION_CATEGORIZATION
    • LATENCY

      public static final org.elasticsearch.xcontent.ParseField LATENCY
    • SUMMARY_COUNT_FIELD_NAME

      public static final org.elasticsearch.xcontent.ParseField SUMMARY_COUNT_FIELD_NAME
    • DETECTORS

      public static final org.elasticsearch.xcontent.ParseField DETECTORS
    • INFLUENCERS

      public static final org.elasticsearch.xcontent.ParseField INFLUENCERS
    • MULTIVARIATE_BY_FIELDS

      public static final org.elasticsearch.xcontent.ParseField MULTIVARIATE_BY_FIELDS
    • ML_CATEGORY_FIELD

      public static final String ML_CATEGORY_FIELD
      See Also:
    • AUTO_CREATED_FIELDS

      public static final Set<String> AUTO_CREATED_FIELDS
    • MAX_CATEGORIZATION_FIELD_LENGTH

      public static final int MAX_CATEGORIZATION_FIELD_LENGTH
      See Also:
    • LENIENT_PARSER

      public static final org.elasticsearch.xcontent.ConstructingObjectParser<AnalysisConfig.Builder,Void> LENIENT_PARSER
    • STRICT_PARSER

      public static final org.elasticsearch.xcontent.ConstructingObjectParser<AnalysisConfig.Builder,Void> STRICT_PARSER
    • MINIMUM_MODEL_PRUNE_WINDOW_BUCKETS

      public static final long MINIMUM_MODEL_PRUNE_WINDOW_BUCKETS
      See Also:
    • DEFAULT_MODEL_PRUNE_WINDOW

      public static final org.elasticsearch.core.TimeValue DEFAULT_MODEL_PRUNE_WINDOW
  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • getBucketSpan

      public org.elasticsearch.core.TimeValue getBucketSpan()
      The analysis bucket span
      Returns:
      The bucketspan or null if not set
    • getCategorizationFieldName

      public String getCategorizationFieldName()
    • getCategorizationFilters

      public List<String> getCategorizationFilters()
    • getCategorizationAnalyzerConfig

      public CategorizationAnalyzerConfig getCategorizationAnalyzerConfig()
    • getPerPartitionCategorizationConfig

      public PerPartitionCategorizationConfig getPerPartitionCategorizationConfig()
    • getLatency

      public org.elasticsearch.core.TimeValue getLatency()
      The latency interval during which out-of-order records should be handled.
      Returns:
      The latency interval or null if not set
    • getSummaryCountFieldName

      public String getSummaryCountFieldName()
      The name of the field that contains counts for pre-summarised input
      Returns:
      The field name or null if not set
    • getDetectors

      public List<Detector> getDetectors()
      The list of analysis detectors. In a valid configuration the list should contain at least 1 Detector
      Returns:
      The Detectors used in this job
    • getInfluencers

      public List<String> getInfluencers()
      The list of influence field names
    • termFields

      public Set<String> termFields()
      Return the list of term fields. These are the influencer fields, partition field, by field and over field of each detector. null and empty strings are filtered from the config.
      Returns:
      Set of term fields - never null
    • extractReferencedFilters

      public Set<String> extractReferencedFilters()
    • getMultivariateByFields

      public Boolean getMultivariateByFields()
    • getModelPruneWindow

      public org.elasticsearch.core.TimeValue getModelPruneWindow()
    • analysisFields

      public Set<String> analysisFields()
      Return the set of fields required by the analysis. These are the influencer fields, metric field, partition field, by field and over field of each detector, plus the summary count field and the categorization field name of the job. null and empty strings are filtered from the config.
      Returns:
      Set of required analysis fields - never null
    • fields

      public List<String> fields()
    • byFields

      public List<String> byFields()
    • overFields

      public List<String> overFields()
    • partitionFields

      public List<String> partitionFields()
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object