Skip to content

Commit c8d9423

Browse files
Auto-generated API code
1 parent 2804b0a commit c8d9423

File tree

4 files changed

+49
-7
lines changed

4 files changed

+49
-7
lines changed

elasticsearch/_async/client/logstash.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ async def put_pipeline(
141141
142142
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-logstash-put-pipeline>`_
143143
144-
:param id: An identifier for the pipeline.
144+
:param id: An identifier for the pipeline. Pipeline IDs must begin with a letter
145+
or underscore and contain only letters, underscores, dashes, hyphens and
146+
numbers.
145147
:param pipeline:
146148
"""
147149
if id in SKIP_IN_PATH:

elasticsearch/_sync/client/logstash.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ def put_pipeline(
141141
142142
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-logstash-put-pipeline>`_
143143
144-
:param id: An identifier for the pipeline.
144+
:param id: An identifier for the pipeline. Pipeline IDs must begin with a letter
145+
or underscore and contain only letters, underscores, dashes, hyphens and
146+
numbers.
145147
:param pipeline:
146148
"""
147149
if id in SKIP_IN_PATH:

elasticsearch/dsl/aggs.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,6 +2960,14 @@ class SignificantTerms(Bucket[_R]):
29602960
the foreground sample with a term divided by the number of
29612961
documents in the background with the term.
29622962
:arg script_heuristic: Customized score, implemented via a script.
2963+
:arg p_value: Significant terms heuristic that calculates the p-value
2964+
between the term existing in foreground and background sets. The
2965+
p-value is the probability of obtaining test results at least as
2966+
extreme as the results actually observed, under the assumption
2967+
that the null hypothesis is correct. The p-value is calculated
2968+
assuming that the foreground set and the background set are
2969+
independent https://en.wikipedia.org/wiki/Bernoulli_trial, with
2970+
the null hypothesis that the probabilities are the same.
29632971
:arg shard_min_doc_count: Regulates the certainty a shard has if the
29642972
term should actually be added to the candidate list or not with
29652973
respect to the `min_doc_count`. Terms will only be considered if
@@ -3013,6 +3021,9 @@ def __init__(
30133021
script_heuristic: Union[
30143022
"types.ScriptedHeuristic", Dict[str, Any], "DefaultType"
30153023
] = DEFAULT,
3024+
p_value: Union[
3025+
"types.PValueHeuristic", Dict[str, Any], "DefaultType"
3026+
] = DEFAULT,
30163027
shard_min_doc_count: Union[int, "DefaultType"] = DEFAULT,
30173028
shard_size: Union[int, "DefaultType"] = DEFAULT,
30183029
size: Union[int, "DefaultType"] = DEFAULT,
@@ -3031,6 +3042,7 @@ def __init__(
30313042
mutual_information=mutual_information,
30323043
percentage=percentage,
30333044
script_heuristic=script_heuristic,
3045+
p_value=p_value,
30343046
shard_min_doc_count=shard_min_doc_count,
30353047
shard_size=shard_size,
30363048
size=size,

elasticsearch/dsl/types.py

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,6 +2673,31 @@ def __init__(
26732673
super().__init__(kwargs)
26742674

26752675

2676+
class PValueHeuristic(AttrDict[Any]):
2677+
"""
2678+
:arg background_is_superset:
2679+
:arg normalize_above: Should the results be normalized when above the
2680+
given value. Allows for consistent significance results at various
2681+
scales. Note: `0` is a special value which means no normalization
2682+
"""
2683+
2684+
background_is_superset: Union[bool, DefaultType]
2685+
normalize_above: Union[int, DefaultType]
2686+
2687+
def __init__(
2688+
self,
2689+
*,
2690+
background_is_superset: Union[bool, DefaultType] = DEFAULT,
2691+
normalize_above: Union[int, DefaultType] = DEFAULT,
2692+
**kwargs: Any,
2693+
):
2694+
if background_is_superset is not DEFAULT:
2695+
kwargs["background_is_superset"] = background_is_superset
2696+
if normalize_above is not DEFAULT:
2697+
kwargs["normalize_above"] = normalize_above
2698+
super().__init__(kwargs)
2699+
2700+
26762701
class PercentageScoreHeuristic(AttrDict[Any]):
26772702
pass
26782703

@@ -3853,24 +3878,25 @@ def __init__(
38533878

38543879
class TextEmbedding(AttrDict[Any]):
38553880
"""
3856-
:arg model_id: (required)
38573881
:arg model_text: (required)
3882+
:arg model_id: Model ID is required for all dense_vector fields but
3883+
may be inferred for semantic_text fields
38583884
"""
38593885

3860-
model_id: Union[str, DefaultType]
38613886
model_text: Union[str, DefaultType]
3887+
model_id: Union[str, DefaultType]
38623888

38633889
def __init__(
38643890
self,
38653891
*,
3866-
model_id: Union[str, DefaultType] = DEFAULT,
38673892
model_text: Union[str, DefaultType] = DEFAULT,
3893+
model_id: Union[str, DefaultType] = DEFAULT,
38683894
**kwargs: Any,
38693895
):
3870-
if model_id is not DEFAULT:
3871-
kwargs["model_id"] = model_id
38723896
if model_text is not DEFAULT:
38733897
kwargs["model_text"] = model_text
3898+
if model_id is not DEFAULT:
3899+
kwargs["model_id"] = model_id
38743900
super().__init__(kwargs)
38753901

38763902

0 commit comments

Comments
 (0)