elasticsearch 8.18.1__py3-none-any.whl → 8.19.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/_async/client/__init__.py +68 -82
- elasticsearch/_async/client/async_search.py +5 -9
- elasticsearch/_async/client/autoscaling.py +4 -4
- elasticsearch/_async/client/cat.py +744 -75
- elasticsearch/_async/client/ccr.py +13 -13
- elasticsearch/_async/client/cluster.py +38 -24
- elasticsearch/_async/client/connector.py +30 -30
- elasticsearch/_async/client/dangling_indices.py +3 -3
- elasticsearch/_async/client/enrich.py +5 -5
- elasticsearch/_async/client/eql.py +13 -5
- elasticsearch/_async/client/esql.py +54 -15
- elasticsearch/_async/client/features.py +2 -2
- elasticsearch/_async/client/fleet.py +13 -13
- elasticsearch/_async/client/graph.py +1 -1
- elasticsearch/_async/client/ilm.py +11 -11
- elasticsearch/_async/client/indices.py +132 -83
- elasticsearch/_async/client/inference.py +519 -112
- elasticsearch/_async/client/ingest.py +9 -16
- elasticsearch/_async/client/license.py +10 -10
- elasticsearch/_async/client/logstash.py +3 -3
- elasticsearch/_async/client/migration.py +3 -3
- elasticsearch/_async/client/ml.py +76 -88
- elasticsearch/_async/client/nodes.py +9 -8
- elasticsearch/_async/client/query_rules.py +8 -8
- elasticsearch/_async/client/rollup.py +8 -8
- elasticsearch/_async/client/search_application.py +10 -10
- elasticsearch/_async/client/searchable_snapshots.py +4 -4
- elasticsearch/_async/client/security.py +72 -80
- elasticsearch/_async/client/shutdown.py +3 -3
- elasticsearch/_async/client/simulate.py +1 -1
- elasticsearch/_async/client/slm.py +9 -9
- elasticsearch/_async/client/snapshot.py +286 -130
- elasticsearch/_async/client/sql.py +7 -7
- elasticsearch/_async/client/ssl.py +1 -1
- elasticsearch/_async/client/synonyms.py +7 -7
- elasticsearch/_async/client/tasks.py +3 -3
- elasticsearch/_async/client/text_structure.py +4 -4
- elasticsearch/_async/client/transform.py +69 -9
- elasticsearch/_async/client/xpack.py +1 -1
- elasticsearch/_sync/client/__init__.py +68 -82
- elasticsearch/_sync/client/async_search.py +5 -9
- elasticsearch/_sync/client/autoscaling.py +4 -4
- elasticsearch/_sync/client/cat.py +744 -75
- elasticsearch/_sync/client/ccr.py +13 -13
- elasticsearch/_sync/client/cluster.py +38 -24
- elasticsearch/_sync/client/connector.py +30 -30
- elasticsearch/_sync/client/dangling_indices.py +3 -3
- elasticsearch/_sync/client/enrich.py +5 -5
- elasticsearch/_sync/client/eql.py +13 -5
- elasticsearch/_sync/client/esql.py +54 -15
- elasticsearch/_sync/client/features.py +2 -2
- elasticsearch/_sync/client/fleet.py +13 -13
- elasticsearch/_sync/client/graph.py +1 -1
- elasticsearch/_sync/client/ilm.py +11 -11
- elasticsearch/_sync/client/indices.py +132 -83
- elasticsearch/_sync/client/inference.py +519 -112
- elasticsearch/_sync/client/ingest.py +9 -16
- elasticsearch/_sync/client/license.py +10 -10
- elasticsearch/_sync/client/logstash.py +3 -3
- elasticsearch/_sync/client/migration.py +3 -3
- elasticsearch/_sync/client/ml.py +76 -88
- elasticsearch/_sync/client/nodes.py +9 -8
- elasticsearch/_sync/client/query_rules.py +8 -8
- elasticsearch/_sync/client/rollup.py +8 -8
- elasticsearch/_sync/client/search_application.py +10 -10
- elasticsearch/_sync/client/searchable_snapshots.py +4 -4
- elasticsearch/_sync/client/security.py +72 -80
- elasticsearch/_sync/client/shutdown.py +3 -3
- elasticsearch/_sync/client/simulate.py +1 -1
- elasticsearch/_sync/client/slm.py +9 -9
- elasticsearch/_sync/client/snapshot.py +286 -130
- elasticsearch/_sync/client/sql.py +7 -7
- elasticsearch/_sync/client/ssl.py +1 -1
- elasticsearch/_sync/client/synonyms.py +7 -7
- elasticsearch/_sync/client/tasks.py +3 -3
- elasticsearch/_sync/client/text_structure.py +4 -4
- elasticsearch/_sync/client/transform.py +69 -9
- elasticsearch/_sync/client/xpack.py +1 -1
- elasticsearch/_version.py +1 -1
- elasticsearch/compat.py +5 -0
- elasticsearch/dsl/__init__.py +2 -1
- elasticsearch/dsl/_async/document.py +85 -1
- elasticsearch/dsl/_sync/document.py +85 -1
- elasticsearch/dsl/aggs.py +22 -3
- elasticsearch/dsl/document_base.py +219 -16
- elasticsearch/dsl/field.py +272 -48
- elasticsearch/dsl/query.py +49 -4
- elasticsearch/dsl/response/aggs.py +1 -1
- elasticsearch/dsl/types.py +247 -27
- elasticsearch/dsl/utils.py +2 -2
- elasticsearch/esql/__init__.py +19 -0
- elasticsearch/esql/esql.py +1156 -0
- elasticsearch/esql/functions.py +1750 -0
- elasticsearch/exceptions.py +2 -0
- {elasticsearch-8.18.1.dist-info → elasticsearch-8.19.1.dist-info}/METADATA +1 -5
- elasticsearch-8.19.1.dist-info/RECORD +164 -0
- elasticsearch-8.18.1.dist-info/RECORD +0 -163
- elasticsearch-8.18.1.dist-info/licenses/LICENSE.txt +0 -175
- elasticsearch-8.18.1.dist-info/licenses/NOTICE.txt +0 -559
- {elasticsearch-8.18.1.dist-info → elasticsearch-8.19.1.dist-info}/WHEEL +0 -0
- {elasticsearch-8.18.1.dist-info → elasticsearch-8.19.1.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.18.1.dist-info → elasticsearch-8.19.1.dist-info}/licenses/NOTICE +0 -0
elasticsearch/dsl/query.py
CHANGED
|
@@ -1382,7 +1382,49 @@ class MoreLikeThis(Query):
|
|
|
1382
1382
|
min_term_freq: Union[int, "DefaultType"] = DEFAULT,
|
|
1383
1383
|
min_word_length: Union[int, "DefaultType"] = DEFAULT,
|
|
1384
1384
|
routing: Union[str, "DefaultType"] = DEFAULT,
|
|
1385
|
-
stop_words: Union[
|
|
1385
|
+
stop_words: Union[
|
|
1386
|
+
Literal[
|
|
1387
|
+
"_arabic_",
|
|
1388
|
+
"_armenian_",
|
|
1389
|
+
"_basque_",
|
|
1390
|
+
"_bengali_",
|
|
1391
|
+
"_brazilian_",
|
|
1392
|
+
"_bulgarian_",
|
|
1393
|
+
"_catalan_",
|
|
1394
|
+
"_cjk_",
|
|
1395
|
+
"_czech_",
|
|
1396
|
+
"_danish_",
|
|
1397
|
+
"_dutch_",
|
|
1398
|
+
"_english_",
|
|
1399
|
+
"_estonian_",
|
|
1400
|
+
"_finnish_",
|
|
1401
|
+
"_french_",
|
|
1402
|
+
"_galician_",
|
|
1403
|
+
"_german_",
|
|
1404
|
+
"_greek_",
|
|
1405
|
+
"_hindi_",
|
|
1406
|
+
"_hungarian_",
|
|
1407
|
+
"_indonesian_",
|
|
1408
|
+
"_irish_",
|
|
1409
|
+
"_italian_",
|
|
1410
|
+
"_latvian_",
|
|
1411
|
+
"_lithuanian_",
|
|
1412
|
+
"_norwegian_",
|
|
1413
|
+
"_persian_",
|
|
1414
|
+
"_portuguese_",
|
|
1415
|
+
"_romanian_",
|
|
1416
|
+
"_russian_",
|
|
1417
|
+
"_serbian_",
|
|
1418
|
+
"_sorani_",
|
|
1419
|
+
"_spanish_",
|
|
1420
|
+
"_swedish_",
|
|
1421
|
+
"_thai_",
|
|
1422
|
+
"_turkish_",
|
|
1423
|
+
"_none_",
|
|
1424
|
+
],
|
|
1425
|
+
Sequence[str],
|
|
1426
|
+
"DefaultType",
|
|
1427
|
+
] = DEFAULT,
|
|
1386
1428
|
unlike: Union[
|
|
1387
1429
|
Union[str, "types.LikeDocument"],
|
|
1388
1430
|
Sequence[Union[str, "types.LikeDocument"]],
|
|
@@ -1992,8 +2034,9 @@ class Regexp(Query):
|
|
|
1992
2034
|
class Rule(Query):
|
|
1993
2035
|
"""
|
|
1994
2036
|
:arg organic: (required)
|
|
1995
|
-
:arg ruleset_ids: (required)
|
|
1996
2037
|
:arg match_criteria: (required)
|
|
2038
|
+
:arg ruleset_ids:
|
|
2039
|
+
:arg ruleset_id:
|
|
1997
2040
|
:arg boost: Floating point number used to decrease or increase the
|
|
1998
2041
|
relevance scores of the query. Boost values are relative to the
|
|
1999
2042
|
default value of 1.0. A boost value between 0 and 1.0 decreases
|
|
@@ -2011,16 +2054,18 @@ class Rule(Query):
|
|
|
2011
2054
|
self,
|
|
2012
2055
|
*,
|
|
2013
2056
|
organic: Union[Query, "DefaultType"] = DEFAULT,
|
|
2014
|
-
ruleset_ids: Union[Sequence[str], "DefaultType"] = DEFAULT,
|
|
2015
2057
|
match_criteria: Any = DEFAULT,
|
|
2058
|
+
ruleset_ids: Union[str, Sequence[str], "DefaultType"] = DEFAULT,
|
|
2059
|
+
ruleset_id: Union[str, "DefaultType"] = DEFAULT,
|
|
2016
2060
|
boost: Union[float, "DefaultType"] = DEFAULT,
|
|
2017
2061
|
_name: Union[str, "DefaultType"] = DEFAULT,
|
|
2018
2062
|
**kwargs: Any,
|
|
2019
2063
|
):
|
|
2020
2064
|
super().__init__(
|
|
2021
2065
|
organic=organic,
|
|
2022
|
-
ruleset_ids=ruleset_ids,
|
|
2023
2066
|
match_criteria=match_criteria,
|
|
2067
|
+
ruleset_ids=ruleset_ids,
|
|
2068
|
+
ruleset_id=ruleset_id,
|
|
2024
2069
|
boost=boost,
|
|
2025
2070
|
_name=_name,
|
|
2026
2071
|
**kwargs,
|
elasticsearch/dsl/types.py
CHANGED
|
@@ -170,6 +170,48 @@ class ChiSquareHeuristic(AttrDict[Any]):
|
|
|
170
170
|
super().__init__(kwargs)
|
|
171
171
|
|
|
172
172
|
|
|
173
|
+
class ChunkingSettings(AttrDict[Any]):
|
|
174
|
+
"""
|
|
175
|
+
:arg strategy: (required) The chunking strategy: `sentence` or `word`.
|
|
176
|
+
Defaults to `sentence` if omitted.
|
|
177
|
+
:arg max_chunk_size: (required) The maximum size of a chunk in words.
|
|
178
|
+
This value cannot be higher than `300` or lower than `20` (for
|
|
179
|
+
`sentence` strategy) or `10` (for `word` strategy). Defaults to
|
|
180
|
+
`250` if omitted.
|
|
181
|
+
:arg overlap: The number of overlapping words for chunks. It is
|
|
182
|
+
applicable only to a `word` chunking strategy. This value cannot
|
|
183
|
+
be higher than half the `max_chunk_size` value. Defaults to `100`
|
|
184
|
+
if omitted.
|
|
185
|
+
:arg sentence_overlap: The number of overlapping sentences for chunks.
|
|
186
|
+
It is applicable only for a `sentence` chunking strategy. It can
|
|
187
|
+
be either `1` or `0`. Defaults to `1` if omitted.
|
|
188
|
+
"""
|
|
189
|
+
|
|
190
|
+
strategy: Union[str, DefaultType]
|
|
191
|
+
max_chunk_size: Union[int, DefaultType]
|
|
192
|
+
overlap: Union[int, DefaultType]
|
|
193
|
+
sentence_overlap: Union[int, DefaultType]
|
|
194
|
+
|
|
195
|
+
def __init__(
|
|
196
|
+
self,
|
|
197
|
+
*,
|
|
198
|
+
strategy: Union[str, DefaultType] = DEFAULT,
|
|
199
|
+
max_chunk_size: Union[int, DefaultType] = DEFAULT,
|
|
200
|
+
overlap: Union[int, DefaultType] = DEFAULT,
|
|
201
|
+
sentence_overlap: Union[int, DefaultType] = DEFAULT,
|
|
202
|
+
**kwargs: Any,
|
|
203
|
+
):
|
|
204
|
+
if strategy is not DEFAULT:
|
|
205
|
+
kwargs["strategy"] = strategy
|
|
206
|
+
if max_chunk_size is not DEFAULT:
|
|
207
|
+
kwargs["max_chunk_size"] = max_chunk_size
|
|
208
|
+
if overlap is not DEFAULT:
|
|
209
|
+
kwargs["overlap"] = overlap
|
|
210
|
+
if sentence_overlap is not DEFAULT:
|
|
211
|
+
kwargs["sentence_overlap"] = sentence_overlap
|
|
212
|
+
super().__init__(kwargs)
|
|
213
|
+
|
|
214
|
+
|
|
173
215
|
class ClassificationInferenceOptions(AttrDict[Any]):
|
|
174
216
|
"""
|
|
175
217
|
:arg num_top_classes: Specifies the number of top class predictions to
|
|
@@ -927,7 +969,7 @@ class GeoDistanceSort(AttrDict[Any]):
|
|
|
927
969
|
|
|
928
970
|
class GeoGridQuery(AttrDict[Any]):
|
|
929
971
|
"""
|
|
930
|
-
:arg
|
|
972
|
+
:arg geotile:
|
|
931
973
|
:arg geohash:
|
|
932
974
|
:arg geohex:
|
|
933
975
|
:arg boost: Floating point number used to decrease or increase the
|
|
@@ -938,7 +980,7 @@ class GeoGridQuery(AttrDict[Any]):
|
|
|
938
980
|
:arg _name:
|
|
939
981
|
"""
|
|
940
982
|
|
|
941
|
-
|
|
983
|
+
geotile: Union[str, DefaultType]
|
|
942
984
|
geohash: Union[str, DefaultType]
|
|
943
985
|
geohex: Union[str, DefaultType]
|
|
944
986
|
boost: Union[float, DefaultType]
|
|
@@ -947,15 +989,15 @@ class GeoGridQuery(AttrDict[Any]):
|
|
|
947
989
|
def __init__(
|
|
948
990
|
self,
|
|
949
991
|
*,
|
|
950
|
-
|
|
992
|
+
geotile: Union[str, DefaultType] = DEFAULT,
|
|
951
993
|
geohash: Union[str, DefaultType] = DEFAULT,
|
|
952
994
|
geohex: Union[str, DefaultType] = DEFAULT,
|
|
953
995
|
boost: Union[float, DefaultType] = DEFAULT,
|
|
954
996
|
_name: Union[str, DefaultType] = DEFAULT,
|
|
955
997
|
**kwargs: Any,
|
|
956
998
|
):
|
|
957
|
-
if
|
|
958
|
-
kwargs["
|
|
999
|
+
if geotile is not DEFAULT:
|
|
1000
|
+
kwargs["geotile"] = geotile
|
|
959
1001
|
if geohash is not DEFAULT:
|
|
960
1002
|
kwargs["geohash"] = geohash
|
|
961
1003
|
if geohex is not DEFAULT:
|
|
@@ -1617,11 +1659,7 @@ class InnerHits(AttrDict[Any]):
|
|
|
1617
1659
|
DefaultType,
|
|
1618
1660
|
]
|
|
1619
1661
|
seq_no_primary_term: Union[bool, DefaultType]
|
|
1620
|
-
fields: Union[
|
|
1621
|
-
Union[str, InstrumentedField],
|
|
1622
|
-
Sequence[Union[str, InstrumentedField]],
|
|
1623
|
-
DefaultType,
|
|
1624
|
-
]
|
|
1662
|
+
fields: Union[Sequence[Union[str, InstrumentedField]], DefaultType]
|
|
1625
1663
|
sort: Union[
|
|
1626
1664
|
Union[Union[str, InstrumentedField], "SortOptions"],
|
|
1627
1665
|
Sequence[Union[Union[str, InstrumentedField], "SortOptions"]],
|
|
@@ -1656,11 +1694,7 @@ class InnerHits(AttrDict[Any]):
|
|
|
1656
1694
|
DefaultType,
|
|
1657
1695
|
] = DEFAULT,
|
|
1658
1696
|
seq_no_primary_term: Union[bool, DefaultType] = DEFAULT,
|
|
1659
|
-
fields: Union[
|
|
1660
|
-
Union[str, InstrumentedField],
|
|
1661
|
-
Sequence[Union[str, InstrumentedField]],
|
|
1662
|
-
DefaultType,
|
|
1663
|
-
] = DEFAULT,
|
|
1697
|
+
fields: Union[Sequence[Union[str, InstrumentedField]], DefaultType] = DEFAULT,
|
|
1664
1698
|
sort: Union[
|
|
1665
1699
|
Union[Union[str, InstrumentedField], "SortOptions"],
|
|
1666
1700
|
Sequence[Union[Union[str, InstrumentedField], "SortOptions"]],
|
|
@@ -1789,6 +1823,8 @@ class IntervalsContainer(AttrDict[Any]):
|
|
|
1789
1823
|
:arg match: Matches analyzed text.
|
|
1790
1824
|
:arg prefix: Matches terms that start with a specified set of
|
|
1791
1825
|
characters.
|
|
1826
|
+
:arg range:
|
|
1827
|
+
:arg regexp:
|
|
1792
1828
|
:arg wildcard: Matches terms using a wildcard pattern.
|
|
1793
1829
|
"""
|
|
1794
1830
|
|
|
@@ -1797,6 +1833,8 @@ class IntervalsContainer(AttrDict[Any]):
|
|
|
1797
1833
|
fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType]
|
|
1798
1834
|
match: Union["IntervalsMatch", Dict[str, Any], DefaultType]
|
|
1799
1835
|
prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType]
|
|
1836
|
+
range: Union["IntervalsRange", Dict[str, Any], DefaultType]
|
|
1837
|
+
regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType]
|
|
1800
1838
|
wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType]
|
|
1801
1839
|
|
|
1802
1840
|
def __init__(
|
|
@@ -1807,6 +1845,8 @@ class IntervalsContainer(AttrDict[Any]):
|
|
|
1807
1845
|
fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType] = DEFAULT,
|
|
1808
1846
|
match: Union["IntervalsMatch", Dict[str, Any], DefaultType] = DEFAULT,
|
|
1809
1847
|
prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType] = DEFAULT,
|
|
1848
|
+
range: Union["IntervalsRange", Dict[str, Any], DefaultType] = DEFAULT,
|
|
1849
|
+
regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType] = DEFAULT,
|
|
1810
1850
|
wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType] = DEFAULT,
|
|
1811
1851
|
**kwargs: Any,
|
|
1812
1852
|
):
|
|
@@ -1820,6 +1860,10 @@ class IntervalsContainer(AttrDict[Any]):
|
|
|
1820
1860
|
kwargs["match"] = match
|
|
1821
1861
|
if prefix is not DEFAULT:
|
|
1822
1862
|
kwargs["prefix"] = prefix
|
|
1863
|
+
if range is not DEFAULT:
|
|
1864
|
+
kwargs["range"] = range
|
|
1865
|
+
if regexp is not DEFAULT:
|
|
1866
|
+
kwargs["regexp"] = regexp
|
|
1823
1867
|
if wildcard is not DEFAULT:
|
|
1824
1868
|
kwargs["wildcard"] = wildcard
|
|
1825
1869
|
super().__init__(kwargs)
|
|
@@ -2040,6 +2084,8 @@ class IntervalsQuery(AttrDict[Any]):
|
|
|
2040
2084
|
:arg match: Matches analyzed text.
|
|
2041
2085
|
:arg prefix: Matches terms that start with a specified set of
|
|
2042
2086
|
characters.
|
|
2087
|
+
:arg range:
|
|
2088
|
+
:arg regexp:
|
|
2043
2089
|
:arg wildcard: Matches terms using a wildcard pattern.
|
|
2044
2090
|
:arg boost: Floating point number used to decrease or increase the
|
|
2045
2091
|
relevance scores of the query. Boost values are relative to the
|
|
@@ -2054,6 +2100,8 @@ class IntervalsQuery(AttrDict[Any]):
|
|
|
2054
2100
|
fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType]
|
|
2055
2101
|
match: Union["IntervalsMatch", Dict[str, Any], DefaultType]
|
|
2056
2102
|
prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType]
|
|
2103
|
+
range: Union["IntervalsRange", Dict[str, Any], DefaultType]
|
|
2104
|
+
regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType]
|
|
2057
2105
|
wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType]
|
|
2058
2106
|
boost: Union[float, DefaultType]
|
|
2059
2107
|
_name: Union[str, DefaultType]
|
|
@@ -2066,6 +2114,8 @@ class IntervalsQuery(AttrDict[Any]):
|
|
|
2066
2114
|
fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType] = DEFAULT,
|
|
2067
2115
|
match: Union["IntervalsMatch", Dict[str, Any], DefaultType] = DEFAULT,
|
|
2068
2116
|
prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType] = DEFAULT,
|
|
2117
|
+
range: Union["IntervalsRange", Dict[str, Any], DefaultType] = DEFAULT,
|
|
2118
|
+
regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType] = DEFAULT,
|
|
2069
2119
|
wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType] = DEFAULT,
|
|
2070
2120
|
boost: Union[float, DefaultType] = DEFAULT,
|
|
2071
2121
|
_name: Union[str, DefaultType] = DEFAULT,
|
|
@@ -2081,6 +2131,10 @@ class IntervalsQuery(AttrDict[Any]):
|
|
|
2081
2131
|
kwargs["match"] = match
|
|
2082
2132
|
if prefix is not DEFAULT:
|
|
2083
2133
|
kwargs["prefix"] = prefix
|
|
2134
|
+
if range is not DEFAULT:
|
|
2135
|
+
kwargs["range"] = range
|
|
2136
|
+
if regexp is not DEFAULT:
|
|
2137
|
+
kwargs["regexp"] = regexp
|
|
2084
2138
|
if wildcard is not DEFAULT:
|
|
2085
2139
|
kwargs["wildcard"] = wildcard
|
|
2086
2140
|
if boost is not DEFAULT:
|
|
@@ -2090,6 +2144,83 @@ class IntervalsQuery(AttrDict[Any]):
|
|
|
2090
2144
|
super().__init__(kwargs)
|
|
2091
2145
|
|
|
2092
2146
|
|
|
2147
|
+
class IntervalsRange(AttrDict[Any]):
|
|
2148
|
+
"""
|
|
2149
|
+
:arg analyzer: Analyzer used to analyze the `prefix`.
|
|
2150
|
+
:arg gte: Lower term, either gte or gt must be provided.
|
|
2151
|
+
:arg gt: Lower term, either gte or gt must be provided.
|
|
2152
|
+
:arg lte: Upper term, either lte or lt must be provided.
|
|
2153
|
+
:arg lt: Upper term, either lte or lt must be provided.
|
|
2154
|
+
:arg use_field: If specified, match intervals from this field rather
|
|
2155
|
+
than the top-level field. The `prefix` is normalized using the
|
|
2156
|
+
search analyzer from this field, unless `analyzer` is specified
|
|
2157
|
+
separately.
|
|
2158
|
+
"""
|
|
2159
|
+
|
|
2160
|
+
analyzer: Union[str, DefaultType]
|
|
2161
|
+
gte: Union[str, DefaultType]
|
|
2162
|
+
gt: Union[str, DefaultType]
|
|
2163
|
+
lte: Union[str, DefaultType]
|
|
2164
|
+
lt: Union[str, DefaultType]
|
|
2165
|
+
use_field: Union[str, InstrumentedField, DefaultType]
|
|
2166
|
+
|
|
2167
|
+
def __init__(
|
|
2168
|
+
self,
|
|
2169
|
+
*,
|
|
2170
|
+
analyzer: Union[str, DefaultType] = DEFAULT,
|
|
2171
|
+
gte: Union[str, DefaultType] = DEFAULT,
|
|
2172
|
+
gt: Union[str, DefaultType] = DEFAULT,
|
|
2173
|
+
lte: Union[str, DefaultType] = DEFAULT,
|
|
2174
|
+
lt: Union[str, DefaultType] = DEFAULT,
|
|
2175
|
+
use_field: Union[str, InstrumentedField, DefaultType] = DEFAULT,
|
|
2176
|
+
**kwargs: Any,
|
|
2177
|
+
):
|
|
2178
|
+
if analyzer is not DEFAULT:
|
|
2179
|
+
kwargs["analyzer"] = analyzer
|
|
2180
|
+
if gte is not DEFAULT:
|
|
2181
|
+
kwargs["gte"] = gte
|
|
2182
|
+
if gt is not DEFAULT:
|
|
2183
|
+
kwargs["gt"] = gt
|
|
2184
|
+
if lte is not DEFAULT:
|
|
2185
|
+
kwargs["lte"] = lte
|
|
2186
|
+
if lt is not DEFAULT:
|
|
2187
|
+
kwargs["lt"] = lt
|
|
2188
|
+
if use_field is not DEFAULT:
|
|
2189
|
+
kwargs["use_field"] = str(use_field)
|
|
2190
|
+
super().__init__(kwargs)
|
|
2191
|
+
|
|
2192
|
+
|
|
2193
|
+
class IntervalsRegexp(AttrDict[Any]):
|
|
2194
|
+
"""
|
|
2195
|
+
:arg pattern: (required) Regex pattern.
|
|
2196
|
+
:arg analyzer: Analyzer used to analyze the `prefix`.
|
|
2197
|
+
:arg use_field: If specified, match intervals from this field rather
|
|
2198
|
+
than the top-level field. The `prefix` is normalized using the
|
|
2199
|
+
search analyzer from this field, unless `analyzer` is specified
|
|
2200
|
+
separately.
|
|
2201
|
+
"""
|
|
2202
|
+
|
|
2203
|
+
pattern: Union[str, DefaultType]
|
|
2204
|
+
analyzer: Union[str, DefaultType]
|
|
2205
|
+
use_field: Union[str, InstrumentedField, DefaultType]
|
|
2206
|
+
|
|
2207
|
+
def __init__(
|
|
2208
|
+
self,
|
|
2209
|
+
*,
|
|
2210
|
+
pattern: Union[str, DefaultType] = DEFAULT,
|
|
2211
|
+
analyzer: Union[str, DefaultType] = DEFAULT,
|
|
2212
|
+
use_field: Union[str, InstrumentedField, DefaultType] = DEFAULT,
|
|
2213
|
+
**kwargs: Any,
|
|
2214
|
+
):
|
|
2215
|
+
if pattern is not DEFAULT:
|
|
2216
|
+
kwargs["pattern"] = pattern
|
|
2217
|
+
if analyzer is not DEFAULT:
|
|
2218
|
+
kwargs["analyzer"] = analyzer
|
|
2219
|
+
if use_field is not DEFAULT:
|
|
2220
|
+
kwargs["use_field"] = str(use_field)
|
|
2221
|
+
super().__init__(kwargs)
|
|
2222
|
+
|
|
2223
|
+
|
|
2093
2224
|
class IntervalsWildcard(AttrDict[Any]):
|
|
2094
2225
|
"""
|
|
2095
2226
|
:arg pattern: (required) Wildcard pattern used to find matching terms.
|
|
@@ -3030,6 +3161,26 @@ class ScriptedHeuristic(AttrDict[Any]):
|
|
|
3030
3161
|
super().__init__(kwargs)
|
|
3031
3162
|
|
|
3032
3163
|
|
|
3164
|
+
class SemanticTextIndexOptions(AttrDict[Any]):
|
|
3165
|
+
"""
|
|
3166
|
+
:arg dense_vector:
|
|
3167
|
+
"""
|
|
3168
|
+
|
|
3169
|
+
dense_vector: Union["DenseVectorIndexOptions", Dict[str, Any], DefaultType]
|
|
3170
|
+
|
|
3171
|
+
def __init__(
|
|
3172
|
+
self,
|
|
3173
|
+
*,
|
|
3174
|
+
dense_vector: Union[
|
|
3175
|
+
"DenseVectorIndexOptions", Dict[str, Any], DefaultType
|
|
3176
|
+
] = DEFAULT,
|
|
3177
|
+
**kwargs: Any,
|
|
3178
|
+
):
|
|
3179
|
+
if dense_vector is not DEFAULT:
|
|
3180
|
+
kwargs["dense_vector"] = dense_vector
|
|
3181
|
+
super().__init__(kwargs)
|
|
3182
|
+
|
|
3183
|
+
|
|
3033
3184
|
class ShapeFieldQuery(AttrDict[Any]):
|
|
3034
3185
|
"""
|
|
3035
3186
|
:arg indexed_shape: Queries using a pre-indexed shape.
|
|
@@ -3107,10 +3258,15 @@ class SortOptions(AttrDict[Any]):
|
|
|
3107
3258
|
|
|
3108
3259
|
class SourceFilter(AttrDict[Any]):
|
|
3109
3260
|
"""
|
|
3110
|
-
:arg
|
|
3111
|
-
|
|
3261
|
+
:arg exclude_vectors: If `true`, vector fields are excluded from the
|
|
3262
|
+
returned source. This option takes precedence over `includes`:
|
|
3263
|
+
any vector field will remain excluded even if it matches an
|
|
3264
|
+
`includes` rule.
|
|
3265
|
+
:arg excludes: A list of fields to exclude from the returned source.
|
|
3266
|
+
:arg includes: A list of fields to include in the returned source.
|
|
3112
3267
|
"""
|
|
3113
3268
|
|
|
3269
|
+
exclude_vectors: Union[bool, DefaultType]
|
|
3114
3270
|
excludes: Union[
|
|
3115
3271
|
Union[str, InstrumentedField],
|
|
3116
3272
|
Sequence[Union[str, InstrumentedField]],
|
|
@@ -3125,6 +3281,7 @@ class SourceFilter(AttrDict[Any]):
|
|
|
3125
3281
|
def __init__(
|
|
3126
3282
|
self,
|
|
3127
3283
|
*,
|
|
3284
|
+
exclude_vectors: Union[bool, DefaultType] = DEFAULT,
|
|
3128
3285
|
excludes: Union[
|
|
3129
3286
|
Union[str, InstrumentedField],
|
|
3130
3287
|
Sequence[Union[str, InstrumentedField]],
|
|
@@ -3137,6 +3294,8 @@ class SourceFilter(AttrDict[Any]):
|
|
|
3137
3294
|
] = DEFAULT,
|
|
3138
3295
|
**kwargs: Any,
|
|
3139
3296
|
):
|
|
3297
|
+
if exclude_vectors is not DEFAULT:
|
|
3298
|
+
kwargs["exclude_vectors"] = exclude_vectors
|
|
3140
3299
|
if excludes is not DEFAULT:
|
|
3141
3300
|
kwargs["excludes"] = str(excludes)
|
|
3142
3301
|
if includes is not DEFAULT:
|
|
@@ -3586,6 +3745,38 @@ class SpanWithinQuery(AttrDict[Any]):
|
|
|
3586
3745
|
super().__init__(kwargs)
|
|
3587
3746
|
|
|
3588
3747
|
|
|
3748
|
+
class SparseVectorIndexOptions(AttrDict[Any]):
|
|
3749
|
+
"""
|
|
3750
|
+
:arg prune: Whether to perform pruning, omitting the non-significant
|
|
3751
|
+
tokens from the query to improve query performance. If prune is
|
|
3752
|
+
true but the pruning_config is not specified, pruning will occur
|
|
3753
|
+
but default values will be used. Default: false
|
|
3754
|
+
:arg pruning_config: Optional pruning configuration. If enabled, this
|
|
3755
|
+
will omit non-significant tokens from the query in order to
|
|
3756
|
+
improve query performance. This is only used if prune is set to
|
|
3757
|
+
true. If prune is set to true but pruning_config is not specified,
|
|
3758
|
+
default values will be used.
|
|
3759
|
+
"""
|
|
3760
|
+
|
|
3761
|
+
prune: Union[bool, DefaultType]
|
|
3762
|
+
pruning_config: Union["TokenPruningConfig", Dict[str, Any], DefaultType]
|
|
3763
|
+
|
|
3764
|
+
def __init__(
|
|
3765
|
+
self,
|
|
3766
|
+
*,
|
|
3767
|
+
prune: Union[bool, DefaultType] = DEFAULT,
|
|
3768
|
+
pruning_config: Union[
|
|
3769
|
+
"TokenPruningConfig", Dict[str, Any], DefaultType
|
|
3770
|
+
] = DEFAULT,
|
|
3771
|
+
**kwargs: Any,
|
|
3772
|
+
):
|
|
3773
|
+
if prune is not DEFAULT:
|
|
3774
|
+
kwargs["prune"] = prune
|
|
3775
|
+
if pruning_config is not DEFAULT:
|
|
3776
|
+
kwargs["pruning_config"] = pruning_config
|
|
3777
|
+
super().__init__(kwargs)
|
|
3778
|
+
|
|
3779
|
+
|
|
3589
3780
|
class SuggestContext(AttrDict[Any]):
|
|
3590
3781
|
"""
|
|
3591
3782
|
:arg name: (required)
|
|
@@ -3624,15 +3815,30 @@ class TDigest(AttrDict[Any]):
|
|
|
3624
3815
|
:arg compression: Limits the maximum number of nodes used by the
|
|
3625
3816
|
underlying TDigest algorithm to `20 * compression`, enabling
|
|
3626
3817
|
control of memory usage and approximation error.
|
|
3818
|
+
:arg execution_hint: The default implementation of TDigest is
|
|
3819
|
+
optimized for performance, scaling to millions or even billions of
|
|
3820
|
+
sample values while maintaining acceptable accuracy levels (close
|
|
3821
|
+
to 1% relative error for millions of samples in some cases). To
|
|
3822
|
+
use an implementation optimized for accuracy, set this parameter
|
|
3823
|
+
to high_accuracy instead. Defaults to `default` if omitted.
|
|
3627
3824
|
"""
|
|
3628
3825
|
|
|
3629
3826
|
compression: Union[int, DefaultType]
|
|
3827
|
+
execution_hint: Union[Literal["default", "high_accuracy"], DefaultType]
|
|
3630
3828
|
|
|
3631
3829
|
def __init__(
|
|
3632
|
-
self,
|
|
3830
|
+
self,
|
|
3831
|
+
*,
|
|
3832
|
+
compression: Union[int, DefaultType] = DEFAULT,
|
|
3833
|
+
execution_hint: Union[
|
|
3834
|
+
Literal["default", "high_accuracy"], DefaultType
|
|
3835
|
+
] = DEFAULT,
|
|
3836
|
+
**kwargs: Any,
|
|
3633
3837
|
):
|
|
3634
3838
|
if compression is not DEFAULT:
|
|
3635
3839
|
kwargs["compression"] = compression
|
|
3840
|
+
if execution_hint is not DEFAULT:
|
|
3841
|
+
kwargs["execution_hint"] = execution_hint
|
|
3636
3842
|
super().__init__(kwargs)
|
|
3637
3843
|
|
|
3638
3844
|
|
|
@@ -4355,7 +4561,7 @@ class ArrayPercentilesItem(AttrDict[Any]):
|
|
|
4355
4561
|
:arg value_as_string:
|
|
4356
4562
|
"""
|
|
4357
4563
|
|
|
4358
|
-
key:
|
|
4564
|
+
key: float
|
|
4359
4565
|
value: Union[float, None]
|
|
4360
4566
|
value_as_string: str
|
|
4361
4567
|
|
|
@@ -4794,7 +5000,7 @@ class ErrorCause(AttrDict[Any]):
|
|
|
4794
5000
|
"""
|
|
4795
5001
|
|
|
4796
5002
|
type: str
|
|
4797
|
-
reason: str
|
|
5003
|
+
reason: Union[str, None]
|
|
4798
5004
|
stack_trace: str
|
|
4799
5005
|
caused_by: "ErrorCause"
|
|
4800
5006
|
root_cause: Sequence["ErrorCause"]
|
|
@@ -5010,9 +5216,11 @@ class FiltersAggregate(AttrDict[Any]):
|
|
|
5010
5216
|
class FiltersBucket(AttrDict[Any]):
|
|
5011
5217
|
"""
|
|
5012
5218
|
:arg doc_count: (required)
|
|
5219
|
+
:arg key:
|
|
5013
5220
|
"""
|
|
5014
5221
|
|
|
5015
5222
|
doc_count: int
|
|
5223
|
+
key: str
|
|
5016
5224
|
|
|
5017
5225
|
|
|
5018
5226
|
class FrequentItemSetsAggregate(AttrDict[Any]):
|
|
@@ -5199,7 +5407,9 @@ class HdrPercentileRanksAggregate(AttrDict[Any]):
|
|
|
5199
5407
|
:arg meta:
|
|
5200
5408
|
"""
|
|
5201
5409
|
|
|
5202
|
-
values: Union[
|
|
5410
|
+
values: Union[
|
|
5411
|
+
Mapping[str, Union[str, float, None]], Sequence["ArrayPercentilesItem"]
|
|
5412
|
+
]
|
|
5203
5413
|
meta: Mapping[str, Any]
|
|
5204
5414
|
|
|
5205
5415
|
|
|
@@ -5209,7 +5419,9 @@ class HdrPercentilesAggregate(AttrDict[Any]):
|
|
|
5209
5419
|
:arg meta:
|
|
5210
5420
|
"""
|
|
5211
5421
|
|
|
5212
|
-
values: Union[
|
|
5422
|
+
values: Union[
|
|
5423
|
+
Mapping[str, Union[str, float, None]], Sequence["ArrayPercentilesItem"]
|
|
5424
|
+
]
|
|
5213
5425
|
meta: Mapping[str, Any]
|
|
5214
5426
|
|
|
5215
5427
|
|
|
@@ -5718,7 +5930,9 @@ class PercentilesBucketAggregate(AttrDict[Any]):
|
|
|
5718
5930
|
:arg meta:
|
|
5719
5931
|
"""
|
|
5720
5932
|
|
|
5721
|
-
values: Union[
|
|
5933
|
+
values: Union[
|
|
5934
|
+
Mapping[str, Union[str, float, None]], Sequence["ArrayPercentilesItem"]
|
|
5935
|
+
]
|
|
5722
5936
|
meta: Mapping[str, Any]
|
|
5723
5937
|
|
|
5724
5938
|
|
|
@@ -5919,17 +6133,19 @@ class SearchProfile(AttrDict[Any]):
|
|
|
5919
6133
|
class ShardFailure(AttrDict[Any]):
|
|
5920
6134
|
"""
|
|
5921
6135
|
:arg reason: (required)
|
|
5922
|
-
:arg shard: (required)
|
|
5923
6136
|
:arg index:
|
|
5924
6137
|
:arg node:
|
|
6138
|
+
:arg shard:
|
|
5925
6139
|
:arg status:
|
|
6140
|
+
:arg primary:
|
|
5926
6141
|
"""
|
|
5927
6142
|
|
|
5928
6143
|
reason: "ErrorCause"
|
|
5929
|
-
shard: int
|
|
5930
6144
|
index: str
|
|
5931
6145
|
node: str
|
|
6146
|
+
shard: int
|
|
5932
6147
|
status: str
|
|
6148
|
+
primary: bool
|
|
5933
6149
|
|
|
5934
6150
|
|
|
5935
6151
|
class ShardProfile(AttrDict[Any]):
|
|
@@ -6253,7 +6469,9 @@ class TDigestPercentileRanksAggregate(AttrDict[Any]):
|
|
|
6253
6469
|
:arg meta:
|
|
6254
6470
|
"""
|
|
6255
6471
|
|
|
6256
|
-
values: Union[
|
|
6472
|
+
values: Union[
|
|
6473
|
+
Mapping[str, Union[str, float, None]], Sequence["ArrayPercentilesItem"]
|
|
6474
|
+
]
|
|
6257
6475
|
meta: Mapping[str, Any]
|
|
6258
6476
|
|
|
6259
6477
|
|
|
@@ -6263,7 +6481,9 @@ class TDigestPercentilesAggregate(AttrDict[Any]):
|
|
|
6263
6481
|
:arg meta:
|
|
6264
6482
|
"""
|
|
6265
6483
|
|
|
6266
|
-
values: Union[
|
|
6484
|
+
values: Union[
|
|
6485
|
+
Mapping[str, Union[str, float, None]], Sequence["ArrayPercentilesItem"]
|
|
6486
|
+
]
|
|
6267
6487
|
meta: Mapping[str, Any]
|
|
6268
6488
|
|
|
6269
6489
|
|
elasticsearch/dsl/utils.py
CHANGED
|
@@ -333,7 +333,7 @@ class DslBase(metaclass=DslMeta):
|
|
|
333
333
|
_expand__to_dot = EXPAND__TO_DOT
|
|
334
334
|
self._params: Dict[str, Any] = {}
|
|
335
335
|
for pname, pvalue in params.items():
|
|
336
|
-
if pvalue
|
|
336
|
+
if pvalue is DEFAULT:
|
|
337
337
|
continue
|
|
338
338
|
# expand "__" to dots
|
|
339
339
|
if "__" in pname and _expand__to_dot:
|
|
@@ -603,7 +603,7 @@ class ObjectBase(AttrDict[Any]):
|
|
|
603
603
|
# if this is a mapped field,
|
|
604
604
|
f = self.__get_field(k)
|
|
605
605
|
if f and f._coerce:
|
|
606
|
-
v = f.serialize(v)
|
|
606
|
+
v = f.serialize(v, skip_empty=skip_empty)
|
|
607
607
|
|
|
608
608
|
# if someone assigned AttrList, unwrap it
|
|
609
609
|
if isinstance(v, AttrList):
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
|
3
|
+
# this work for additional information regarding copyright
|
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
+
# not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
# KIND, either express or implied. See the License for the
|
|
15
|
+
# specific language governing permissions and limitations
|
|
16
|
+
# under the License.
|
|
17
|
+
|
|
18
|
+
from ..dsl import E # noqa: F401
|
|
19
|
+
from .esql import ESQL, ESQLBase, and_, not_, or_ # noqa: F401
|