elasticsearch 9.0.1__py3-none-any.whl → 9.1.0__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.
Files changed (108) hide show
  1. elasticsearch/__init__.py +3 -3
  2. elasticsearch/_async/client/__init__.py +93 -249
  3. elasticsearch/_async/client/async_search.py +4 -4
  4. elasticsearch/_async/client/autoscaling.py +4 -4
  5. elasticsearch/_async/client/cat.py +620 -58
  6. elasticsearch/_async/client/ccr.py +13 -13
  7. elasticsearch/_async/client/cluster.py +32 -22
  8. elasticsearch/_async/client/connector.py +30 -30
  9. elasticsearch/_async/client/dangling_indices.py +3 -3
  10. elasticsearch/_async/client/enrich.py +5 -5
  11. elasticsearch/_async/client/eql.py +14 -6
  12. elasticsearch/_async/client/esql.py +125 -9
  13. elasticsearch/_async/client/features.py +2 -2
  14. elasticsearch/_async/client/fleet.py +3 -3
  15. elasticsearch/_async/client/graph.py +1 -1
  16. elasticsearch/_async/client/ilm.py +11 -11
  17. elasticsearch/_async/client/indices.py +605 -117
  18. elasticsearch/_async/client/inference.py +523 -116
  19. elasticsearch/_async/client/ingest.py +9 -16
  20. elasticsearch/_async/client/license.py +11 -11
  21. elasticsearch/_async/client/logstash.py +3 -3
  22. elasticsearch/_async/client/migration.py +3 -3
  23. elasticsearch/_async/client/ml.py +75 -87
  24. elasticsearch/_async/client/monitoring.py +1 -1
  25. elasticsearch/_async/client/nodes.py +7 -7
  26. elasticsearch/_async/client/query_rules.py +8 -8
  27. elasticsearch/_async/client/rollup.py +9 -30
  28. elasticsearch/_async/client/search_application.py +10 -10
  29. elasticsearch/_async/client/searchable_snapshots.py +4 -4
  30. elasticsearch/_async/client/security.py +79 -81
  31. elasticsearch/_async/client/shutdown.py +3 -3
  32. elasticsearch/_async/client/simulate.py +1 -1
  33. elasticsearch/_async/client/slm.py +9 -9
  34. elasticsearch/_async/client/snapshot.py +64 -21
  35. elasticsearch/_async/client/sql.py +6 -6
  36. elasticsearch/_async/client/ssl.py +1 -1
  37. elasticsearch/_async/client/synonyms.py +26 -7
  38. elasticsearch/_async/client/tasks.py +4 -4
  39. elasticsearch/_async/client/text_structure.py +4 -4
  40. elasticsearch/_async/client/transform.py +11 -11
  41. elasticsearch/_async/client/watcher.py +17 -15
  42. elasticsearch/_async/client/xpack.py +2 -2
  43. elasticsearch/_otel.py +8 -8
  44. elasticsearch/_sync/client/__init__.py +93 -249
  45. elasticsearch/_sync/client/async_search.py +4 -4
  46. elasticsearch/_sync/client/autoscaling.py +4 -4
  47. elasticsearch/_sync/client/cat.py +620 -58
  48. elasticsearch/_sync/client/ccr.py +13 -13
  49. elasticsearch/_sync/client/cluster.py +32 -22
  50. elasticsearch/_sync/client/connector.py +30 -30
  51. elasticsearch/_sync/client/dangling_indices.py +3 -3
  52. elasticsearch/_sync/client/enrich.py +5 -5
  53. elasticsearch/_sync/client/eql.py +14 -6
  54. elasticsearch/_sync/client/esql.py +125 -9
  55. elasticsearch/_sync/client/features.py +2 -2
  56. elasticsearch/_sync/client/fleet.py +3 -3
  57. elasticsearch/_sync/client/graph.py +1 -1
  58. elasticsearch/_sync/client/ilm.py +11 -11
  59. elasticsearch/_sync/client/indices.py +605 -117
  60. elasticsearch/_sync/client/inference.py +523 -116
  61. elasticsearch/_sync/client/ingest.py +9 -16
  62. elasticsearch/_sync/client/license.py +11 -11
  63. elasticsearch/_sync/client/logstash.py +3 -3
  64. elasticsearch/_sync/client/migration.py +3 -3
  65. elasticsearch/_sync/client/ml.py +75 -87
  66. elasticsearch/_sync/client/monitoring.py +1 -1
  67. elasticsearch/_sync/client/nodes.py +7 -7
  68. elasticsearch/_sync/client/query_rules.py +8 -8
  69. elasticsearch/_sync/client/rollup.py +9 -30
  70. elasticsearch/_sync/client/search_application.py +10 -10
  71. elasticsearch/_sync/client/searchable_snapshots.py +4 -4
  72. elasticsearch/_sync/client/security.py +79 -81
  73. elasticsearch/_sync/client/shutdown.py +3 -3
  74. elasticsearch/_sync/client/simulate.py +1 -1
  75. elasticsearch/_sync/client/slm.py +9 -9
  76. elasticsearch/_sync/client/snapshot.py +64 -21
  77. elasticsearch/_sync/client/sql.py +6 -6
  78. elasticsearch/_sync/client/ssl.py +1 -1
  79. elasticsearch/_sync/client/synonyms.py +26 -7
  80. elasticsearch/_sync/client/tasks.py +4 -4
  81. elasticsearch/_sync/client/text_structure.py +4 -4
  82. elasticsearch/_sync/client/transform.py +11 -11
  83. elasticsearch/_sync/client/watcher.py +17 -15
  84. elasticsearch/_sync/client/xpack.py +2 -2
  85. elasticsearch/_version.py +1 -1
  86. elasticsearch/compat.py +5 -0
  87. elasticsearch/dsl/__init__.py +2 -1
  88. elasticsearch/dsl/_async/document.py +1 -1
  89. elasticsearch/dsl/_sync/document.py +1 -1
  90. elasticsearch/dsl/aggs.py +20 -0
  91. elasticsearch/dsl/document_base.py +177 -17
  92. elasticsearch/dsl/field.py +241 -38
  93. elasticsearch/dsl/query.py +50 -5
  94. elasticsearch/dsl/response/__init__.py +1 -1
  95. elasticsearch/dsl/types.py +245 -21
  96. elasticsearch/dsl/utils.py +1 -1
  97. elasticsearch/esql/__init__.py +18 -0
  98. elasticsearch/esql/esql.py +1105 -0
  99. elasticsearch/esql/esql1.py1 +307 -0
  100. elasticsearch/esql/functions.py +1738 -0
  101. {elasticsearch-9.0.1.dist-info → elasticsearch-9.1.0.dist-info}/METADATA +3 -6
  102. elasticsearch-9.1.0.dist-info/RECORD +164 -0
  103. elasticsearch-9.0.1.dist-info/RECORD +0 -162
  104. elasticsearch-9.0.1.dist-info/licenses/LICENSE.txt +0 -175
  105. elasticsearch-9.0.1.dist-info/licenses/NOTICE.txt +0 -559
  106. {elasticsearch-9.0.1.dist-info → elasticsearch-9.1.0.dist-info}/WHEEL +0 -0
  107. {elasticsearch-9.0.1.dist-info → elasticsearch-9.1.0.dist-info}/licenses/LICENSE +0 -0
  108. {elasticsearch-9.0.1.dist-info → elasticsearch-9.1.0.dist-info}/licenses/NOTICE +0 -0
@@ -1084,7 +1084,7 @@ class Knn(Query):
1084
1084
  :arg similarity: The minimum similarity for a vector to be considered
1085
1085
  a match
1086
1086
  :arg rescore_vector: Apply oversampling and rescoring to quantized
1087
- vectors *
1087
+ vectors
1088
1088
  :arg boost: Floating point number used to decrease or increase the
1089
1089
  relevance scores of the query. Boost values are relative to the
1090
1090
  default value of 1.0. A boost value between 0 and 1.0 decreases
@@ -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[str, Sequence[str], "DefaultType"] = DEFAULT,
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,
@@ -363,7 +363,7 @@ class UpdateByQueryResponse(AttrDict[Any], Generic[_R]):
363
363
  deleted: int
364
364
  requests_per_second: float
365
365
  retries: "types.Retries"
366
- task: Union[str, int]
366
+ task: str
367
367
  timed_out: bool
368
368
  took: Any
369
369
  total: int
@@ -142,6 +142,48 @@ class ChiSquareHeuristic(AttrDict[Any]):
142
142
  super().__init__(kwargs)
143
143
 
144
144
 
145
+ class ChunkingSettings(AttrDict[Any]):
146
+ """
147
+ :arg strategy: (required) The chunking strategy: `sentence` or `word`.
148
+ Defaults to `sentence` if omitted.
149
+ :arg max_chunk_size: (required) The maximum size of a chunk in words.
150
+ This value cannot be higher than `300` or lower than `20` (for
151
+ `sentence` strategy) or `10` (for `word` strategy). Defaults to
152
+ `250` if omitted.
153
+ :arg overlap: The number of overlapping words for chunks. It is
154
+ applicable only to a `word` chunking strategy. This value cannot
155
+ be higher than half the `max_chunk_size` value. Defaults to `100`
156
+ if omitted.
157
+ :arg sentence_overlap: The number of overlapping sentences for chunks.
158
+ It is applicable only for a `sentence` chunking strategy. It can
159
+ be either `1` or `0`. Defaults to `1` if omitted.
160
+ """
161
+
162
+ strategy: Union[str, DefaultType]
163
+ max_chunk_size: Union[int, DefaultType]
164
+ overlap: Union[int, DefaultType]
165
+ sentence_overlap: Union[int, DefaultType]
166
+
167
+ def __init__(
168
+ self,
169
+ *,
170
+ strategy: Union[str, DefaultType] = DEFAULT,
171
+ max_chunk_size: Union[int, DefaultType] = DEFAULT,
172
+ overlap: Union[int, DefaultType] = DEFAULT,
173
+ sentence_overlap: Union[int, DefaultType] = DEFAULT,
174
+ **kwargs: Any,
175
+ ):
176
+ if strategy is not DEFAULT:
177
+ kwargs["strategy"] = strategy
178
+ if max_chunk_size is not DEFAULT:
179
+ kwargs["max_chunk_size"] = max_chunk_size
180
+ if overlap is not DEFAULT:
181
+ kwargs["overlap"] = overlap
182
+ if sentence_overlap is not DEFAULT:
183
+ kwargs["sentence_overlap"] = sentence_overlap
184
+ super().__init__(kwargs)
185
+
186
+
145
187
  class ClassificationInferenceOptions(AttrDict[Any]):
146
188
  """
147
189
  :arg num_top_classes: Specifies the number of top class predictions to
@@ -329,6 +371,9 @@ class DenseVectorIndexOptions(AttrDict[Any]):
329
371
  :arg m: The number of neighbors each node will be connected to in the
330
372
  HNSW graph. Only applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`,
331
373
  and `int4_hnsw` index types. Defaults to `16` if omitted.
374
+ :arg rescore_vector: The rescore vector options. This is only
375
+ applicable to `bbq_hnsw`, `int4_hnsw`, `int8_hnsw`, `bbq_flat`,
376
+ `int4_flat`, and `int8_flat` index types.
332
377
  """
333
378
 
334
379
  type: Union[
@@ -347,6 +392,9 @@ class DenseVectorIndexOptions(AttrDict[Any]):
347
392
  confidence_interval: Union[float, DefaultType]
348
393
  ef_construction: Union[int, DefaultType]
349
394
  m: Union[int, DefaultType]
395
+ rescore_vector: Union[
396
+ "DenseVectorIndexOptionsRescoreVector", Dict[str, Any], DefaultType
397
+ ]
350
398
 
351
399
  def __init__(
352
400
  self,
@@ -367,6 +415,9 @@ class DenseVectorIndexOptions(AttrDict[Any]):
367
415
  confidence_interval: Union[float, DefaultType] = DEFAULT,
368
416
  ef_construction: Union[int, DefaultType] = DEFAULT,
369
417
  m: Union[int, DefaultType] = DEFAULT,
418
+ rescore_vector: Union[
419
+ "DenseVectorIndexOptionsRescoreVector", Dict[str, Any], DefaultType
420
+ ] = DEFAULT,
370
421
  **kwargs: Any,
371
422
  ):
372
423
  if type is not DEFAULT:
@@ -377,6 +428,29 @@ class DenseVectorIndexOptions(AttrDict[Any]):
377
428
  kwargs["ef_construction"] = ef_construction
378
429
  if m is not DEFAULT:
379
430
  kwargs["m"] = m
431
+ if rescore_vector is not DEFAULT:
432
+ kwargs["rescore_vector"] = rescore_vector
433
+ super().__init__(kwargs)
434
+
435
+
436
+ class DenseVectorIndexOptionsRescoreVector(AttrDict[Any]):
437
+ """
438
+ :arg oversample: (required) The oversampling factor to use when
439
+ searching for the nearest neighbor. This is only applicable to the
440
+ quantized formats: `bbq_*`, `int4_*`, and `int8_*`. When provided,
441
+ `oversample * k` vectors will be gathered and then their scores
442
+ will be re-computed with the original vectors. valid values are
443
+ between `1.0` and `10.0` (inclusive), or `0` exactly to disable
444
+ oversampling.
445
+ """
446
+
447
+ oversample: Union[float, DefaultType]
448
+
449
+ def __init__(
450
+ self, *, oversample: Union[float, DefaultType] = DEFAULT, **kwargs: Any
451
+ ):
452
+ if oversample is not DEFAULT:
453
+ kwargs["oversample"] = oversample
380
454
  super().__init__(kwargs)
381
455
 
382
456
 
@@ -871,7 +945,7 @@ class GeoDistanceSort(AttrDict[Any]):
871
945
 
872
946
  class GeoGridQuery(AttrDict[Any]):
873
947
  """
874
- :arg geogrid:
948
+ :arg geotile:
875
949
  :arg geohash:
876
950
  :arg geohex:
877
951
  :arg boost: Floating point number used to decrease or increase the
@@ -882,7 +956,7 @@ class GeoGridQuery(AttrDict[Any]):
882
956
  :arg _name:
883
957
  """
884
958
 
885
- geogrid: Union[str, DefaultType]
959
+ geotile: Union[str, DefaultType]
886
960
  geohash: Union[str, DefaultType]
887
961
  geohex: Union[str, DefaultType]
888
962
  boost: Union[float, DefaultType]
@@ -891,15 +965,15 @@ class GeoGridQuery(AttrDict[Any]):
891
965
  def __init__(
892
966
  self,
893
967
  *,
894
- geogrid: Union[str, DefaultType] = DEFAULT,
968
+ geotile: Union[str, DefaultType] = DEFAULT,
895
969
  geohash: Union[str, DefaultType] = DEFAULT,
896
970
  geohex: Union[str, DefaultType] = DEFAULT,
897
971
  boost: Union[float, DefaultType] = DEFAULT,
898
972
  _name: Union[str, DefaultType] = DEFAULT,
899
973
  **kwargs: Any,
900
974
  ):
901
- if geogrid is not DEFAULT:
902
- kwargs["geogrid"] = geogrid
975
+ if geotile is not DEFAULT:
976
+ kwargs["geotile"] = geotile
903
977
  if geohash is not DEFAULT:
904
978
  kwargs["geohash"] = geohash
905
979
  if geohex is not DEFAULT:
@@ -1137,6 +1211,7 @@ class Highlight(AttrDict[Any]):
1137
1211
 
1138
1212
  fields: Union[
1139
1213
  Mapping[Union[str, InstrumentedField], "HighlightField"],
1214
+ Sequence[Mapping[Union[str, InstrumentedField], "HighlightField"]],
1140
1215
  Dict[str, Any],
1141
1216
  DefaultType,
1142
1217
  ]
@@ -1168,6 +1243,7 @@ class Highlight(AttrDict[Any]):
1168
1243
  *,
1169
1244
  fields: Union[
1170
1245
  Mapping[Union[str, InstrumentedField], "HighlightField"],
1246
+ Sequence[Mapping[Union[str, InstrumentedField], "HighlightField"]],
1171
1247
  Dict[str, Any],
1172
1248
  DefaultType,
1173
1249
  ] = DEFAULT,
@@ -1561,11 +1637,7 @@ class InnerHits(AttrDict[Any]):
1561
1637
  DefaultType,
1562
1638
  ]
1563
1639
  seq_no_primary_term: Union[bool, DefaultType]
1564
- fields: Union[
1565
- Union[str, InstrumentedField],
1566
- Sequence[Union[str, InstrumentedField]],
1567
- DefaultType,
1568
- ]
1640
+ fields: Union[Sequence[Union[str, InstrumentedField]], DefaultType]
1569
1641
  sort: Union[
1570
1642
  Union[Union[str, InstrumentedField], "SortOptions"],
1571
1643
  Sequence[Union[Union[str, InstrumentedField], "SortOptions"]],
@@ -1600,11 +1672,7 @@ class InnerHits(AttrDict[Any]):
1600
1672
  DefaultType,
1601
1673
  ] = DEFAULT,
1602
1674
  seq_no_primary_term: Union[bool, DefaultType] = DEFAULT,
1603
- fields: Union[
1604
- Union[str, InstrumentedField],
1605
- Sequence[Union[str, InstrumentedField]],
1606
- DefaultType,
1607
- ] = DEFAULT,
1675
+ fields: Union[Sequence[Union[str, InstrumentedField]], DefaultType] = DEFAULT,
1608
1676
  sort: Union[
1609
1677
  Union[Union[str, InstrumentedField], "SortOptions"],
1610
1678
  Sequence[Union[Union[str, InstrumentedField], "SortOptions"]],
@@ -1733,6 +1801,8 @@ class IntervalsContainer(AttrDict[Any]):
1733
1801
  :arg match: Matches analyzed text.
1734
1802
  :arg prefix: Matches terms that start with a specified set of
1735
1803
  characters.
1804
+ :arg range:
1805
+ :arg regexp:
1736
1806
  :arg wildcard: Matches terms using a wildcard pattern.
1737
1807
  """
1738
1808
 
@@ -1741,6 +1811,8 @@ class IntervalsContainer(AttrDict[Any]):
1741
1811
  fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType]
1742
1812
  match: Union["IntervalsMatch", Dict[str, Any], DefaultType]
1743
1813
  prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType]
1814
+ range: Union["IntervalsRange", Dict[str, Any], DefaultType]
1815
+ regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType]
1744
1816
  wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType]
1745
1817
 
1746
1818
  def __init__(
@@ -1751,6 +1823,8 @@ class IntervalsContainer(AttrDict[Any]):
1751
1823
  fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType] = DEFAULT,
1752
1824
  match: Union["IntervalsMatch", Dict[str, Any], DefaultType] = DEFAULT,
1753
1825
  prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType] = DEFAULT,
1826
+ range: Union["IntervalsRange", Dict[str, Any], DefaultType] = DEFAULT,
1827
+ regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType] = DEFAULT,
1754
1828
  wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType] = DEFAULT,
1755
1829
  **kwargs: Any,
1756
1830
  ):
@@ -1764,6 +1838,10 @@ class IntervalsContainer(AttrDict[Any]):
1764
1838
  kwargs["match"] = match
1765
1839
  if prefix is not DEFAULT:
1766
1840
  kwargs["prefix"] = prefix
1841
+ if range is not DEFAULT:
1842
+ kwargs["range"] = range
1843
+ if regexp is not DEFAULT:
1844
+ kwargs["regexp"] = regexp
1767
1845
  if wildcard is not DEFAULT:
1768
1846
  kwargs["wildcard"] = wildcard
1769
1847
  super().__init__(kwargs)
@@ -1984,6 +2062,8 @@ class IntervalsQuery(AttrDict[Any]):
1984
2062
  :arg match: Matches analyzed text.
1985
2063
  :arg prefix: Matches terms that start with a specified set of
1986
2064
  characters.
2065
+ :arg range:
2066
+ :arg regexp:
1987
2067
  :arg wildcard: Matches terms using a wildcard pattern.
1988
2068
  :arg boost: Floating point number used to decrease or increase the
1989
2069
  relevance scores of the query. Boost values are relative to the
@@ -1998,6 +2078,8 @@ class IntervalsQuery(AttrDict[Any]):
1998
2078
  fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType]
1999
2079
  match: Union["IntervalsMatch", Dict[str, Any], DefaultType]
2000
2080
  prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType]
2081
+ range: Union["IntervalsRange", Dict[str, Any], DefaultType]
2082
+ regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType]
2001
2083
  wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType]
2002
2084
  boost: Union[float, DefaultType]
2003
2085
  _name: Union[str, DefaultType]
@@ -2010,6 +2092,8 @@ class IntervalsQuery(AttrDict[Any]):
2010
2092
  fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType] = DEFAULT,
2011
2093
  match: Union["IntervalsMatch", Dict[str, Any], DefaultType] = DEFAULT,
2012
2094
  prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType] = DEFAULT,
2095
+ range: Union["IntervalsRange", Dict[str, Any], DefaultType] = DEFAULT,
2096
+ regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType] = DEFAULT,
2013
2097
  wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType] = DEFAULT,
2014
2098
  boost: Union[float, DefaultType] = DEFAULT,
2015
2099
  _name: Union[str, DefaultType] = DEFAULT,
@@ -2025,6 +2109,10 @@ class IntervalsQuery(AttrDict[Any]):
2025
2109
  kwargs["match"] = match
2026
2110
  if prefix is not DEFAULT:
2027
2111
  kwargs["prefix"] = prefix
2112
+ if range is not DEFAULT:
2113
+ kwargs["range"] = range
2114
+ if regexp is not DEFAULT:
2115
+ kwargs["regexp"] = regexp
2028
2116
  if wildcard is not DEFAULT:
2029
2117
  kwargs["wildcard"] = wildcard
2030
2118
  if boost is not DEFAULT:
@@ -2034,6 +2122,83 @@ class IntervalsQuery(AttrDict[Any]):
2034
2122
  super().__init__(kwargs)
2035
2123
 
2036
2124
 
2125
+ class IntervalsRange(AttrDict[Any]):
2126
+ """
2127
+ :arg analyzer: Analyzer used to analyze the `prefix`.
2128
+ :arg gte: Lower term, either gte or gt must be provided.
2129
+ :arg gt: Lower term, either gte or gt must be provided.
2130
+ :arg lte: Upper term, either lte or lt must be provided.
2131
+ :arg lt: Upper term, either lte or lt must be provided.
2132
+ :arg use_field: If specified, match intervals from this field rather
2133
+ than the top-level field. The `prefix` is normalized using the
2134
+ search analyzer from this field, unless `analyzer` is specified
2135
+ separately.
2136
+ """
2137
+
2138
+ analyzer: Union[str, DefaultType]
2139
+ gte: Union[str, DefaultType]
2140
+ gt: Union[str, DefaultType]
2141
+ lte: Union[str, DefaultType]
2142
+ lt: Union[str, DefaultType]
2143
+ use_field: Union[str, InstrumentedField, DefaultType]
2144
+
2145
+ def __init__(
2146
+ self,
2147
+ *,
2148
+ analyzer: Union[str, DefaultType] = DEFAULT,
2149
+ gte: Union[str, DefaultType] = DEFAULT,
2150
+ gt: Union[str, DefaultType] = DEFAULT,
2151
+ lte: Union[str, DefaultType] = DEFAULT,
2152
+ lt: Union[str, DefaultType] = DEFAULT,
2153
+ use_field: Union[str, InstrumentedField, DefaultType] = DEFAULT,
2154
+ **kwargs: Any,
2155
+ ):
2156
+ if analyzer is not DEFAULT:
2157
+ kwargs["analyzer"] = analyzer
2158
+ if gte is not DEFAULT:
2159
+ kwargs["gte"] = gte
2160
+ if gt is not DEFAULT:
2161
+ kwargs["gt"] = gt
2162
+ if lte is not DEFAULT:
2163
+ kwargs["lte"] = lte
2164
+ if lt is not DEFAULT:
2165
+ kwargs["lt"] = lt
2166
+ if use_field is not DEFAULT:
2167
+ kwargs["use_field"] = str(use_field)
2168
+ super().__init__(kwargs)
2169
+
2170
+
2171
+ class IntervalsRegexp(AttrDict[Any]):
2172
+ """
2173
+ :arg pattern: (required) Regex pattern.
2174
+ :arg analyzer: Analyzer used to analyze the `prefix`.
2175
+ :arg use_field: If specified, match intervals from this field rather
2176
+ than the top-level field. The `prefix` is normalized using the
2177
+ search analyzer from this field, unless `analyzer` is specified
2178
+ separately.
2179
+ """
2180
+
2181
+ pattern: Union[str, DefaultType]
2182
+ analyzer: Union[str, DefaultType]
2183
+ use_field: Union[str, InstrumentedField, DefaultType]
2184
+
2185
+ def __init__(
2186
+ self,
2187
+ *,
2188
+ pattern: Union[str, DefaultType] = DEFAULT,
2189
+ analyzer: Union[str, DefaultType] = DEFAULT,
2190
+ use_field: Union[str, InstrumentedField, DefaultType] = DEFAULT,
2191
+ **kwargs: Any,
2192
+ ):
2193
+ if pattern is not DEFAULT:
2194
+ kwargs["pattern"] = pattern
2195
+ if analyzer is not DEFAULT:
2196
+ kwargs["analyzer"] = analyzer
2197
+ if use_field is not DEFAULT:
2198
+ kwargs["use_field"] = str(use_field)
2199
+ super().__init__(kwargs)
2200
+
2201
+
2037
2202
  class IntervalsWildcard(AttrDict[Any]):
2038
2203
  """
2039
2204
  :arg pattern: (required) Wildcard pattern used to find matching terms.
@@ -3051,10 +3216,15 @@ class SortOptions(AttrDict[Any]):
3051
3216
 
3052
3217
  class SourceFilter(AttrDict[Any]):
3053
3218
  """
3054
- :arg excludes:
3055
- :arg includes:
3219
+ :arg exclude_vectors: If `true`, vector fields are excluded from the
3220
+ returned source. This option takes precedence over `includes`:
3221
+ any vector field will remain excluded even if it matches an
3222
+ `includes` rule.
3223
+ :arg excludes: A list of fields to exclude from the returned source.
3224
+ :arg includes: A list of fields to include in the returned source.
3056
3225
  """
3057
3226
 
3227
+ exclude_vectors: Union[bool, DefaultType]
3058
3228
  excludes: Union[
3059
3229
  Union[str, InstrumentedField],
3060
3230
  Sequence[Union[str, InstrumentedField]],
@@ -3069,6 +3239,7 @@ class SourceFilter(AttrDict[Any]):
3069
3239
  def __init__(
3070
3240
  self,
3071
3241
  *,
3242
+ exclude_vectors: Union[bool, DefaultType] = DEFAULT,
3072
3243
  excludes: Union[
3073
3244
  Union[str, InstrumentedField],
3074
3245
  Sequence[Union[str, InstrumentedField]],
@@ -3081,6 +3252,8 @@ class SourceFilter(AttrDict[Any]):
3081
3252
  ] = DEFAULT,
3082
3253
  **kwargs: Any,
3083
3254
  ):
3255
+ if exclude_vectors is not DEFAULT:
3256
+ kwargs["exclude_vectors"] = exclude_vectors
3084
3257
  if excludes is not DEFAULT:
3085
3258
  kwargs["excludes"] = str(excludes)
3086
3259
  if includes is not DEFAULT:
@@ -3530,6 +3703,38 @@ class SpanWithinQuery(AttrDict[Any]):
3530
3703
  super().__init__(kwargs)
3531
3704
 
3532
3705
 
3706
+ class SparseVectorIndexOptions(AttrDict[Any]):
3707
+ """
3708
+ :arg prune: Whether to perform pruning, omitting the non-significant
3709
+ tokens from the query to improve query performance. If prune is
3710
+ true but the pruning_config is not specified, pruning will occur
3711
+ but default values will be used. Default: false
3712
+ :arg pruning_config: Optional pruning configuration. If enabled, this
3713
+ will omit non-significant tokens from the query in order to
3714
+ improve query performance. This is only used if prune is set to
3715
+ true. If prune is set to true but pruning_config is not specified,
3716
+ default values will be used.
3717
+ """
3718
+
3719
+ prune: Union[bool, DefaultType]
3720
+ pruning_config: Union["TokenPruningConfig", Dict[str, Any], DefaultType]
3721
+
3722
+ def __init__(
3723
+ self,
3724
+ *,
3725
+ prune: Union[bool, DefaultType] = DEFAULT,
3726
+ pruning_config: Union[
3727
+ "TokenPruningConfig", Dict[str, Any], DefaultType
3728
+ ] = DEFAULT,
3729
+ **kwargs: Any,
3730
+ ):
3731
+ if prune is not DEFAULT:
3732
+ kwargs["prune"] = prune
3733
+ if pruning_config is not DEFAULT:
3734
+ kwargs["pruning_config"] = pruning_config
3735
+ super().__init__(kwargs)
3736
+
3737
+
3533
3738
  class SuggestContext(AttrDict[Any]):
3534
3739
  """
3535
3740
  :arg name: (required)
@@ -3568,15 +3773,30 @@ class TDigest(AttrDict[Any]):
3568
3773
  :arg compression: Limits the maximum number of nodes used by the
3569
3774
  underlying TDigest algorithm to `20 * compression`, enabling
3570
3775
  control of memory usage and approximation error.
3776
+ :arg execution_hint: The default implementation of TDigest is
3777
+ optimized for performance, scaling to millions or even billions of
3778
+ sample values while maintaining acceptable accuracy levels (close
3779
+ to 1% relative error for millions of samples in some cases). To
3780
+ use an implementation optimized for accuracy, set this parameter
3781
+ to high_accuracy instead. Defaults to `default` if omitted.
3571
3782
  """
3572
3783
 
3573
3784
  compression: Union[int, DefaultType]
3785
+ execution_hint: Union[Literal["default", "high_accuracy"], DefaultType]
3574
3786
 
3575
3787
  def __init__(
3576
- self, *, compression: Union[int, DefaultType] = DEFAULT, **kwargs: Any
3788
+ self,
3789
+ *,
3790
+ compression: Union[int, DefaultType] = DEFAULT,
3791
+ execution_hint: Union[
3792
+ Literal["default", "high_accuracy"], DefaultType
3793
+ ] = DEFAULT,
3794
+ **kwargs: Any,
3577
3795
  ):
3578
3796
  if compression is not DEFAULT:
3579
3797
  kwargs["compression"] = compression
3798
+ if execution_hint is not DEFAULT:
3799
+ kwargs["execution_hint"] = execution_hint
3580
3800
  super().__init__(kwargs)
3581
3801
 
3582
3802
 
@@ -4046,7 +4266,7 @@ class WeightedTokensQuery(AttrDict[Any]):
4046
4266
  :arg _name:
4047
4267
  """
4048
4268
 
4049
- tokens: Union[Mapping[str, float], DefaultType]
4269
+ tokens: Union[Mapping[str, float], Sequence[Mapping[str, float]], DefaultType]
4050
4270
  pruning_config: Union["TokenPruningConfig", Dict[str, Any], DefaultType]
4051
4271
  boost: Union[float, DefaultType]
4052
4272
  _name: Union[str, DefaultType]
@@ -4054,7 +4274,9 @@ class WeightedTokensQuery(AttrDict[Any]):
4054
4274
  def __init__(
4055
4275
  self,
4056
4276
  *,
4057
- tokens: Union[Mapping[str, float], DefaultType] = DEFAULT,
4277
+ tokens: Union[
4278
+ Mapping[str, float], Sequence[Mapping[str, float]], DefaultType
4279
+ ] = DEFAULT,
4058
4280
  pruning_config: Union[
4059
4281
  "TokenPruningConfig", Dict[str, Any], DefaultType
4060
4282
  ] = DEFAULT,
@@ -4740,7 +4962,7 @@ class ErrorCause(AttrDict[Any]):
4740
4962
  """
4741
4963
 
4742
4964
  type: str
4743
- reason: str
4965
+ reason: Union[str, None]
4744
4966
  stack_trace: str
4745
4967
  caused_by: "ErrorCause"
4746
4968
  root_cause: Sequence["ErrorCause"]
@@ -4956,9 +5178,11 @@ class FiltersAggregate(AttrDict[Any]):
4956
5178
  class FiltersBucket(AttrDict[Any]):
4957
5179
  """
4958
5180
  :arg doc_count: (required)
5181
+ :arg key:
4959
5182
  """
4960
5183
 
4961
5184
  doc_count: int
5185
+ key: str
4962
5186
 
4963
5187
 
4964
5188
  class FrequentItemSetsAggregate(AttrDict[Any]):
@@ -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 == DEFAULT:
336
+ if pvalue is DEFAULT:
337
337
  continue
338
338
  # expand "__" to dots
339
339
  if "__" in pname and _expand__to_dot:
@@ -0,0 +1,18 @@
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 .esql import ESQL, and_, not_, or_ # noqa: F401