Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion elasticsearch/_async/client/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ async def put_pipeline(

`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-logstash-put-pipeline>`_

:param id: An identifier for the pipeline.
:param id: An identifier for the pipeline. Pipeline IDs must begin with a letter
or underscore and contain only letters, underscores, dashes, hyphens and
numbers.
:param pipeline:
"""
if id in SKIP_IN_PATH:
Expand Down
4 changes: 3 additions & 1 deletion elasticsearch/_sync/client/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def put_pipeline(

`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-logstash-put-pipeline>`_

:param id: An identifier for the pipeline.
:param id: An identifier for the pipeline. Pipeline IDs must begin with a letter
or underscore and contain only letters, underscores, dashes, hyphens and
numbers.
:param pipeline:
"""
if id in SKIP_IN_PATH:
Expand Down
97 changes: 97 additions & 0 deletions elasticsearch/dsl/aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,54 @@ def __init__(
)


class CartesianBounds(Agg[_R]):
"""
A metric aggregation that computes the spatial bounding box containing
all values for a Point or Shape field.

:arg field: The field on which to run the aggregation.
:arg missing: The value to apply to documents that do not have a
value. By default, documents without a value are ignored.
:arg script:
"""

name = "cartesian_bounds"

def __init__(
self,
*,
field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
missing: Union[str, int, float, bool, "DefaultType"] = DEFAULT,
script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
**kwargs: Any,
):
super().__init__(field=field, missing=missing, script=script, **kwargs)


class CartesianCentroid(Agg[_R]):
"""
A metric aggregation that computes the weighted centroid from all
coordinate values for point and shape fields.

:arg field: The field on which to run the aggregation.
:arg missing: The value to apply to documents that do not have a
value. By default, documents without a value are ignored.
:arg script:
"""

name = "cartesian_centroid"

def __init__(
self,
*,
field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
missing: Union[str, int, float, bool, "DefaultType"] = DEFAULT,
script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
**kwargs: Any,
):
super().__init__(field=field, missing=missing, script=script, **kwargs)


class CategorizeText(Bucket[_R]):
"""
A multi-bucket aggregation that groups semi-structured text into
Expand Down Expand Up @@ -725,6 +773,43 @@ def __init__(
)


class ChangePoint(Pipeline[_R]):
"""
A sibling pipeline that detects, spikes, dips, and change points in a
metric. Given a distribution of values provided by the sibling multi-
bucket aggregation, this aggregation indicates the bucket of any spike
or dip and/or the bucket at which the largest change in the
distribution of values, if they are statistically significant. There
must be at least 22 bucketed values. Fewer than 1,000 is preferred.

:arg format: `DecimalFormat` pattern for the output value. If
specified, the formatted value is returned in the aggregation’s
`value_as_string` property.
:arg gap_policy: Policy to apply when gaps are found in the data.
Defaults to `skip` if omitted.
:arg buckets_path: Path to the buckets that contain one set of values
to correlate.
"""

name = "change_point"

def __init__(
self,
*,
format: Union[str, "DefaultType"] = DEFAULT,
gap_policy: Union[
Literal["skip", "insert_zeros", "keep_values"], "DefaultType"
] = DEFAULT,
buckets_path: Union[
str, Sequence[str], Mapping[str, str], "DefaultType"
] = DEFAULT,
**kwargs: Any,
):
super().__init__(
format=format, gap_policy=gap_policy, buckets_path=buckets_path, **kwargs
)


class Children(Bucket[_R]):
"""
A single bucket aggregation that selects child documents that have the
Expand Down Expand Up @@ -2960,6 +3045,14 @@ class SignificantTerms(Bucket[_R]):
the foreground sample with a term divided by the number of
documents in the background with the term.
:arg script_heuristic: Customized score, implemented via a script.
:arg p_value: Significant terms heuristic that calculates the p-value
between the term existing in foreground and background sets. The
p-value is the probability of obtaining test results at least as
extreme as the results actually observed, under the assumption
that the null hypothesis is correct. The p-value is calculated
assuming that the foreground set and the background set are
independent https://en.wikipedia.org/wiki/Bernoulli_trial, with
the null hypothesis that the probabilities are the same.
:arg shard_min_doc_count: Regulates the certainty a shard has if the
term should actually be added to the candidate list or not with
respect to the `min_doc_count`. Terms will only be considered if
Expand Down Expand Up @@ -3013,6 +3106,9 @@ def __init__(
script_heuristic: Union[
"types.ScriptedHeuristic", Dict[str, Any], "DefaultType"
] = DEFAULT,
p_value: Union[
"types.PValueHeuristic", Dict[str, Any], "DefaultType"
] = DEFAULT,
shard_min_doc_count: Union[int, "DefaultType"] = DEFAULT,
shard_size: Union[int, "DefaultType"] = DEFAULT,
size: Union[int, "DefaultType"] = DEFAULT,
Expand All @@ -3031,6 +3127,7 @@ def __init__(
mutual_information=mutual_information,
percentage=percentage,
script_heuristic=script_heuristic,
p_value=p_value,
shard_min_doc_count=shard_min_doc_count,
shard_size=shard_size,
size=size,
Expand Down
3 changes: 3 additions & 0 deletions elasticsearch/dsl/response/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,13 @@ def search_after(self) -> "SearchBase[_R]":
"types.SimpleValueAggregate",
"types.DerivativeAggregate",
"types.BucketMetricValueAggregate",
"types.ChangePointAggregate",
"types.StatsAggregate",
"types.StatsBucketAggregate",
"types.ExtendedStatsAggregate",
"types.ExtendedStatsBucketAggregate",
"types.CartesianBoundsAggregate",
"types.CartesianCentroidAggregate",
"types.GeoBoundsAggregate",
"types.GeoCentroidAggregate",
"types.HistogramAggregate",
Expand Down
Loading