Class DatafeedConfig.Builder
java.lang.Object
co.elastic.clients.elasticsearch.ml.DatafeedConfig.Builder
- All Implemented Interfaces:
ObjectBuilder<DatafeedConfig>
- Enclosing class:
- DatafeedConfig
public static class DatafeedConfig.Builder extends java.lang.Object implements ObjectBuilder<DatafeedConfig>
Builder for
DatafeedConfig
.-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description DatafeedConfig.Builder
addIndexes(java.lang.String value)
Add a value toindexes(List)
, creating the list if needed.DatafeedConfig.Builder
addIndices(java.lang.String value)
Add a value toindices(List)
, creating the list if needed.DatafeedConfig.Builder
aggregations(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)
Setaggregations(Map)
to a singleton map.DatafeedConfig.Builder
aggregations(java.util.Map<java.lang.String,Aggregation> value)
If set, the datafeed performs aggregation searches.DatafeedConfig.Builder
aggs(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)
Setaggs(Map)
to a singleton map.DatafeedConfig.Builder
aggs(java.util.Map<java.lang.String,Aggregation> value)
API name:aggs
DatafeedConfig
build()
Builds aDatafeedConfig
.DatafeedConfig.Builder
chunkingConfig(ChunkingConfig value)
Datafeeds might be required to search over long time periods, for several months or years.DatafeedConfig.Builder
chunkingConfig(java.util.function.Function<ChunkingConfig.Builder,ObjectBuilder<ChunkingConfig>> fn)
Datafeeds might be required to search over long time periods, for several months or years.DatafeedConfig.Builder
datafeedId(java.lang.String value)
A numerical character string that uniquely identifies the datafeed.DatafeedConfig.Builder
delayedDataCheckConfig(DelayedDataCheckConfig value)
Specifies whether the datafeed checks for missing data and the size of the window.DatafeedConfig.Builder
delayedDataCheckConfig(java.util.function.Function<DelayedDataCheckConfig.Builder,ObjectBuilder<DelayedDataCheckConfig>> fn)
Specifies whether the datafeed checks for missing data and the size of the window.DatafeedConfig.Builder
frequency(java.lang.String value)
The interval at which scheduled queries are made while the datafeed runs in real time.DatafeedConfig.Builder
indexes(java.lang.String... value)
API name:indexes
DatafeedConfig.Builder
indexes(java.util.List<java.lang.String> value)
API name:indexes
DatafeedConfig.Builder
indices(java.lang.String... value)
Required - An array of index names.DatafeedConfig.Builder
indices(java.util.List<java.lang.String> value)
Required - An array of index names.DatafeedConfig.Builder
indicesOptions(DatafeedIndicesOptions value)
Specifies index expansion options that are used during search.DatafeedConfig.Builder
indicesOptions(java.util.function.Function<DatafeedIndicesOptions.Builder,ObjectBuilder<DatafeedIndicesOptions>> fn)
Specifies index expansion options that are used during search.DatafeedConfig.Builder
jobId(java.lang.String value)
API name:job_id
DatafeedConfig.Builder
maxEmptySearches(java.lang.Integer value)
If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents.DatafeedConfig.Builder
putAggregations(java.lang.String key, Aggregation value)
Add a key/value toaggregations(Map)
, creating the map if needed.DatafeedConfig.Builder
putAggregations(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)
Add a key/value toaggregations(Map)
, creating the map if needed.DatafeedConfig.Builder
putAggs(java.lang.String key, Aggregation value)
Add a key/value toaggs(Map)
, creating the map if needed.DatafeedConfig.Builder
putAggs(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)
Add a key/value toaggs(Map)
, creating the map if needed.DatafeedConfig.Builder
putRuntimeMappings(java.lang.String key, RuntimeField value)
Add a key/value toruntimeMappings(Map)
, creating the map if needed.DatafeedConfig.Builder
putRuntimeMappings(java.lang.String key, java.util.function.Function<RuntimeField.Builder,ObjectBuilder<RuntimeField>> fn)
Add a key/value toruntimeMappings(Map)
, creating the map if needed.DatafeedConfig.Builder
putScriptFields(java.lang.String key, ScriptField value)
Add a key/value toscriptFields(Map)
, creating the map if needed.DatafeedConfig.Builder
putScriptFields(java.lang.String key, java.util.function.Function<ScriptField.Builder,ObjectBuilder<ScriptField>> fn)
Add a key/value toscriptFields(Map)
, creating the map if needed.DatafeedConfig.Builder
query(Query value)
Required - The Elasticsearch query domain-specific language (DSL).DatafeedConfig.Builder
query(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)
Required - The Elasticsearch query domain-specific language (DSL).DatafeedConfig.Builder
queryDelay(java.lang.String value)
The number of seconds behind real time that data is queried.DatafeedConfig.Builder
runtimeMappings(java.lang.String key, java.util.function.Function<RuntimeField.Builder,ObjectBuilder<RuntimeField>> fn)
SetruntimeMappings(Map)
to a singleton map.DatafeedConfig.Builder
runtimeMappings(java.util.Map<java.lang.String,RuntimeField> value)
Specifies runtime fields for the datafeed search.DatafeedConfig.Builder
scriptFields(java.lang.String key, java.util.function.Function<ScriptField.Builder,ObjectBuilder<ScriptField>> fn)
SetscriptFields(Map)
to a singleton map.DatafeedConfig.Builder
scriptFields(java.util.Map<java.lang.String,ScriptField> value)
Specifies scripts that evaluate custom expressions and returns script fields to the datafeed.DatafeedConfig.Builder
scrollSize(java.lang.Integer value)
The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
aggregations
public DatafeedConfig.Builder aggregations(@Nullable java.util.Map<java.lang.String,Aggregation> value)If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data.API name:
aggregations
-
putAggregations
Add a key/value toaggregations(Map)
, creating the map if needed. -
aggregations
public DatafeedConfig.Builder aggregations(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)Setaggregations(Map)
to a singleton map. -
putAggregations
public DatafeedConfig.Builder putAggregations(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)Add a key/value toaggregations(Map)
, creating the map if needed. -
aggs
API name:aggs
-
putAggs
Add a key/value toaggs(Map)
, creating the map if needed. -
aggs
public DatafeedConfig.Builder aggs(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)Setaggs(Map)
to a singleton map. -
putAggs
public DatafeedConfig.Builder putAggs(java.lang.String key, java.util.function.Function<Aggregation.Builder,ObjectBuilder<Aggregation>> fn)Add a key/value toaggs(Map)
, creating the map if needed. -
chunkingConfig
Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option.API name:
chunking_config
-
chunkingConfig
public DatafeedConfig.Builder chunkingConfig(java.util.function.Function<ChunkingConfig.Builder,ObjectBuilder<ChunkingConfig>> fn)Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option.API name:
chunking_config
-
datafeedId
A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.API name:
datafeed_id
-
delayedDataCheckConfig
Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that thequery_delay
option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds.API name:
delayed_data_check_config
-
delayedDataCheckConfig
public DatafeedConfig.Builder delayedDataCheckConfig(java.util.function.Function<DelayedDataCheckConfig.Builder,ObjectBuilder<DelayedDataCheckConfig>> fn)Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that thequery_delay
option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds.API name:
delayed_data_check_config
-
frequency
The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example:150s
. When frequency is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.API name:
frequency
-
indexes
API name:indexes
-
indexes
API name:indexes
-
addIndexes
Add a value toindexes(List)
, creating the list if needed. -
indices
Required - An array of index names. Wildcards are supported.API name:
indices
-
indices
Required - An array of index names. Wildcards are supported.API name:
indices
-
addIndices
Add a value toindices(List)
, creating the list if needed. -
indicesOptions
Specifies index expansion options that are used during search.API name:
indices_options
-
indicesOptions
public DatafeedConfig.Builder indicesOptions(java.util.function.Function<DatafeedIndicesOptions.Builder,ObjectBuilder<DatafeedIndicesOptions>> fn)Specifies index expansion options that are used during search.API name:
indices_options
-
jobId
API name:job_id
-
maxEmptySearches
If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop afterfrequency
timesmax_empty_searches
of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped.API name:
max_empty_searches
-
query
Required - The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch.API name:
query
-
query
public DatafeedConfig.Builder query(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)Required - The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch.API name:
query
-
queryDelay
The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between60s
and120s
. This randomness improves the query performance when there are multiple jobs running on the same node.API name:
query_delay
-
runtimeMappings
public DatafeedConfig.Builder runtimeMappings(@Nullable java.util.Map<java.lang.String,RuntimeField> value)Specifies runtime fields for the datafeed search.API name:
runtime_mappings
-
putRuntimeMappings
Add a key/value toruntimeMappings(Map)
, creating the map if needed. -
runtimeMappings
public DatafeedConfig.Builder runtimeMappings(java.lang.String key, java.util.function.Function<RuntimeField.Builder,ObjectBuilder<RuntimeField>> fn)SetruntimeMappings(Map)
to a singleton map. -
putRuntimeMappings
public DatafeedConfig.Builder putRuntimeMappings(java.lang.String key, java.util.function.Function<RuntimeField.Builder,ObjectBuilder<RuntimeField>> fn)Add a key/value toruntimeMappings(Map)
, creating the map if needed. -
scriptFields
public DatafeedConfig.Builder scriptFields(@Nullable java.util.Map<java.lang.String,ScriptField> value)Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields.API name:
script_fields
-
putScriptFields
Add a key/value toscriptFields(Map)
, creating the map if needed. -
scriptFields
public DatafeedConfig.Builder scriptFields(java.lang.String key, java.util.function.Function<ScriptField.Builder,ObjectBuilder<ScriptField>> fn)SetscriptFields(Map)
to a singleton map. -
putScriptFields
public DatafeedConfig.Builder putScriptFields(java.lang.String key, java.util.function.Function<ScriptField.Builder,ObjectBuilder<ScriptField>> fn)Add a key/value toscriptFields(Map)
, creating the map if needed. -
scrollSize
The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value ofindex.max_result_window
, which is 10,000 by default.API name:
scroll_size
-
build
Builds aDatafeedConfig
.- Specified by:
build
in interfaceObjectBuilder<DatafeedConfig>
- Throws:
java.lang.NullPointerException
- if some of the required fields are null.
-