elasticsearch 9.0.1__py3-none-any.whl → 9.0.3__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 (52) hide show
  1. elasticsearch/_async/client/__init__.py +47 -203
  2. elasticsearch/_async/client/cat.py +594 -32
  3. elasticsearch/_async/client/cluster.py +14 -4
  4. elasticsearch/_async/client/eql.py +10 -2
  5. elasticsearch/_async/client/esql.py +17 -4
  6. elasticsearch/_async/client/indices.py +100 -47
  7. elasticsearch/_async/client/inference.py +110 -75
  8. elasticsearch/_async/client/ingest.py +0 -7
  9. elasticsearch/_async/client/license.py +4 -4
  10. elasticsearch/_async/client/ml.py +6 -17
  11. elasticsearch/_async/client/monitoring.py +1 -1
  12. elasticsearch/_async/client/rollup.py +1 -22
  13. elasticsearch/_async/client/security.py +11 -17
  14. elasticsearch/_async/client/snapshot.py +6 -0
  15. elasticsearch/_async/client/synonyms.py +1 -0
  16. elasticsearch/_async/client/watcher.py +4 -2
  17. elasticsearch/_sync/client/__init__.py +47 -203
  18. elasticsearch/_sync/client/cat.py +594 -32
  19. elasticsearch/_sync/client/cluster.py +14 -4
  20. elasticsearch/_sync/client/eql.py +10 -2
  21. elasticsearch/_sync/client/esql.py +17 -4
  22. elasticsearch/_sync/client/indices.py +100 -47
  23. elasticsearch/_sync/client/inference.py +110 -75
  24. elasticsearch/_sync/client/ingest.py +0 -7
  25. elasticsearch/_sync/client/license.py +4 -4
  26. elasticsearch/_sync/client/ml.py +6 -17
  27. elasticsearch/_sync/client/monitoring.py +1 -1
  28. elasticsearch/_sync/client/rollup.py +1 -22
  29. elasticsearch/_sync/client/security.py +11 -17
  30. elasticsearch/_sync/client/snapshot.py +6 -0
  31. elasticsearch/_sync/client/synonyms.py +1 -0
  32. elasticsearch/_sync/client/watcher.py +4 -2
  33. elasticsearch/_version.py +1 -1
  34. elasticsearch/compat.py +5 -0
  35. elasticsearch/dsl/__init__.py +2 -1
  36. elasticsearch/dsl/_async/document.py +1 -1
  37. elasticsearch/dsl/_sync/document.py +1 -1
  38. elasticsearch/dsl/document_base.py +176 -16
  39. elasticsearch/dsl/field.py +223 -38
  40. elasticsearch/dsl/query.py +49 -4
  41. elasticsearch/dsl/types.py +107 -16
  42. elasticsearch/dsl/utils.py +1 -1
  43. elasticsearch/esql/__init__.py +18 -0
  44. elasticsearch/esql/esql.py +1105 -0
  45. elasticsearch/esql/functions.py +1738 -0
  46. {elasticsearch-9.0.1.dist-info → elasticsearch-9.0.3.dist-info}/METADATA +1 -3
  47. {elasticsearch-9.0.1.dist-info → elasticsearch-9.0.3.dist-info}/RECORD +50 -49
  48. elasticsearch-9.0.1.dist-info/licenses/LICENSE.txt +0 -175
  49. elasticsearch-9.0.1.dist-info/licenses/NOTICE.txt +0 -559
  50. {elasticsearch-9.0.1.dist-info → elasticsearch-9.0.3.dist-info}/WHEEL +0 -0
  51. {elasticsearch-9.0.1.dist-info → elasticsearch-9.0.3.dist-info}/licenses/LICENSE +0 -0
  52. {elasticsearch-9.0.1.dist-info → elasticsearch-9.0.3.dist-info}/licenses/NOTICE +0 -0
@@ -871,7 +871,7 @@ class GeoDistanceSort(AttrDict[Any]):
871
871
 
872
872
  class GeoGridQuery(AttrDict[Any]):
873
873
  """
874
- :arg geogrid:
874
+ :arg geotile:
875
875
  :arg geohash:
876
876
  :arg geohex:
877
877
  :arg boost: Floating point number used to decrease or increase the
@@ -882,7 +882,7 @@ class GeoGridQuery(AttrDict[Any]):
882
882
  :arg _name:
883
883
  """
884
884
 
885
- geogrid: Union[str, DefaultType]
885
+ geotile: Union[str, DefaultType]
886
886
  geohash: Union[str, DefaultType]
887
887
  geohex: Union[str, DefaultType]
888
888
  boost: Union[float, DefaultType]
@@ -891,15 +891,15 @@ class GeoGridQuery(AttrDict[Any]):
891
891
  def __init__(
892
892
  self,
893
893
  *,
894
- geogrid: Union[str, DefaultType] = DEFAULT,
894
+ geotile: Union[str, DefaultType] = DEFAULT,
895
895
  geohash: Union[str, DefaultType] = DEFAULT,
896
896
  geohex: Union[str, DefaultType] = DEFAULT,
897
897
  boost: Union[float, DefaultType] = DEFAULT,
898
898
  _name: Union[str, DefaultType] = DEFAULT,
899
899
  **kwargs: Any,
900
900
  ):
901
- if geogrid is not DEFAULT:
902
- kwargs["geogrid"] = geogrid
901
+ if geotile is not DEFAULT:
902
+ kwargs["geotile"] = geotile
903
903
  if geohash is not DEFAULT:
904
904
  kwargs["geohash"] = geohash
905
905
  if geohex is not DEFAULT:
@@ -1561,11 +1561,7 @@ class InnerHits(AttrDict[Any]):
1561
1561
  DefaultType,
1562
1562
  ]
1563
1563
  seq_no_primary_term: Union[bool, DefaultType]
1564
- fields: Union[
1565
- Union[str, InstrumentedField],
1566
- Sequence[Union[str, InstrumentedField]],
1567
- DefaultType,
1568
- ]
1564
+ fields: Union[Sequence[Union[str, InstrumentedField]], DefaultType]
1569
1565
  sort: Union[
1570
1566
  Union[Union[str, InstrumentedField], "SortOptions"],
1571
1567
  Sequence[Union[Union[str, InstrumentedField], "SortOptions"]],
@@ -1600,11 +1596,7 @@ class InnerHits(AttrDict[Any]):
1600
1596
  DefaultType,
1601
1597
  ] = DEFAULT,
1602
1598
  seq_no_primary_term: Union[bool, DefaultType] = DEFAULT,
1603
- fields: Union[
1604
- Union[str, InstrumentedField],
1605
- Sequence[Union[str, InstrumentedField]],
1606
- DefaultType,
1607
- ] = DEFAULT,
1599
+ fields: Union[Sequence[Union[str, InstrumentedField]], DefaultType] = DEFAULT,
1608
1600
  sort: Union[
1609
1601
  Union[Union[str, InstrumentedField], "SortOptions"],
1610
1602
  Sequence[Union[Union[str, InstrumentedField], "SortOptions"]],
@@ -1733,6 +1725,8 @@ class IntervalsContainer(AttrDict[Any]):
1733
1725
  :arg match: Matches analyzed text.
1734
1726
  :arg prefix: Matches terms that start with a specified set of
1735
1727
  characters.
1728
+ :arg range:
1729
+ :arg regexp:
1736
1730
  :arg wildcard: Matches terms using a wildcard pattern.
1737
1731
  """
1738
1732
 
@@ -1741,6 +1735,8 @@ class IntervalsContainer(AttrDict[Any]):
1741
1735
  fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType]
1742
1736
  match: Union["IntervalsMatch", Dict[str, Any], DefaultType]
1743
1737
  prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType]
1738
+ range: Union["IntervalsRange", Dict[str, Any], DefaultType]
1739
+ regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType]
1744
1740
  wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType]
1745
1741
 
1746
1742
  def __init__(
@@ -1751,6 +1747,8 @@ class IntervalsContainer(AttrDict[Any]):
1751
1747
  fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType] = DEFAULT,
1752
1748
  match: Union["IntervalsMatch", Dict[str, Any], DefaultType] = DEFAULT,
1753
1749
  prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType] = DEFAULT,
1750
+ range: Union["IntervalsRange", Dict[str, Any], DefaultType] = DEFAULT,
1751
+ regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType] = DEFAULT,
1754
1752
  wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType] = DEFAULT,
1755
1753
  **kwargs: Any,
1756
1754
  ):
@@ -1764,6 +1762,10 @@ class IntervalsContainer(AttrDict[Any]):
1764
1762
  kwargs["match"] = match
1765
1763
  if prefix is not DEFAULT:
1766
1764
  kwargs["prefix"] = prefix
1765
+ if range is not DEFAULT:
1766
+ kwargs["range"] = range
1767
+ if regexp is not DEFAULT:
1768
+ kwargs["regexp"] = regexp
1767
1769
  if wildcard is not DEFAULT:
1768
1770
  kwargs["wildcard"] = wildcard
1769
1771
  super().__init__(kwargs)
@@ -1984,6 +1986,8 @@ class IntervalsQuery(AttrDict[Any]):
1984
1986
  :arg match: Matches analyzed text.
1985
1987
  :arg prefix: Matches terms that start with a specified set of
1986
1988
  characters.
1989
+ :arg range:
1990
+ :arg regexp:
1987
1991
  :arg wildcard: Matches terms using a wildcard pattern.
1988
1992
  :arg boost: Floating point number used to decrease or increase the
1989
1993
  relevance scores of the query. Boost values are relative to the
@@ -1998,6 +2002,8 @@ class IntervalsQuery(AttrDict[Any]):
1998
2002
  fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType]
1999
2003
  match: Union["IntervalsMatch", Dict[str, Any], DefaultType]
2000
2004
  prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType]
2005
+ range: Union["IntervalsRange", Dict[str, Any], DefaultType]
2006
+ regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType]
2001
2007
  wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType]
2002
2008
  boost: Union[float, DefaultType]
2003
2009
  _name: Union[str, DefaultType]
@@ -2010,6 +2016,8 @@ class IntervalsQuery(AttrDict[Any]):
2010
2016
  fuzzy: Union["IntervalsFuzzy", Dict[str, Any], DefaultType] = DEFAULT,
2011
2017
  match: Union["IntervalsMatch", Dict[str, Any], DefaultType] = DEFAULT,
2012
2018
  prefix: Union["IntervalsPrefix", Dict[str, Any], DefaultType] = DEFAULT,
2019
+ range: Union["IntervalsRange", Dict[str, Any], DefaultType] = DEFAULT,
2020
+ regexp: Union["IntervalsRegexp", Dict[str, Any], DefaultType] = DEFAULT,
2013
2021
  wildcard: Union["IntervalsWildcard", Dict[str, Any], DefaultType] = DEFAULT,
2014
2022
  boost: Union[float, DefaultType] = DEFAULT,
2015
2023
  _name: Union[str, DefaultType] = DEFAULT,
@@ -2025,6 +2033,10 @@ class IntervalsQuery(AttrDict[Any]):
2025
2033
  kwargs["match"] = match
2026
2034
  if prefix is not DEFAULT:
2027
2035
  kwargs["prefix"] = prefix
2036
+ if range is not DEFAULT:
2037
+ kwargs["range"] = range
2038
+ if regexp is not DEFAULT:
2039
+ kwargs["regexp"] = regexp
2028
2040
  if wildcard is not DEFAULT:
2029
2041
  kwargs["wildcard"] = wildcard
2030
2042
  if boost is not DEFAULT:
@@ -2034,6 +2046,83 @@ class IntervalsQuery(AttrDict[Any]):
2034
2046
  super().__init__(kwargs)
2035
2047
 
2036
2048
 
2049
+ class IntervalsRange(AttrDict[Any]):
2050
+ """
2051
+ :arg analyzer: Analyzer used to analyze the `prefix`.
2052
+ :arg gte: Lower term, either gte or gt must be provided.
2053
+ :arg gt: Lower term, either gte or gt must be provided.
2054
+ :arg lte: Upper term, either lte or lt must be provided.
2055
+ :arg lt: Upper term, either lte or lt must be provided.
2056
+ :arg use_field: If specified, match intervals from this field rather
2057
+ than the top-level field. The `prefix` is normalized using the
2058
+ search analyzer from this field, unless `analyzer` is specified
2059
+ separately.
2060
+ """
2061
+
2062
+ analyzer: Union[str, DefaultType]
2063
+ gte: Union[str, DefaultType]
2064
+ gt: Union[str, DefaultType]
2065
+ lte: Union[str, DefaultType]
2066
+ lt: Union[str, DefaultType]
2067
+ use_field: Union[str, InstrumentedField, DefaultType]
2068
+
2069
+ def __init__(
2070
+ self,
2071
+ *,
2072
+ analyzer: Union[str, DefaultType] = DEFAULT,
2073
+ gte: Union[str, DefaultType] = DEFAULT,
2074
+ gt: Union[str, DefaultType] = DEFAULT,
2075
+ lte: Union[str, DefaultType] = DEFAULT,
2076
+ lt: Union[str, DefaultType] = DEFAULT,
2077
+ use_field: Union[str, InstrumentedField, DefaultType] = DEFAULT,
2078
+ **kwargs: Any,
2079
+ ):
2080
+ if analyzer is not DEFAULT:
2081
+ kwargs["analyzer"] = analyzer
2082
+ if gte is not DEFAULT:
2083
+ kwargs["gte"] = gte
2084
+ if gt is not DEFAULT:
2085
+ kwargs["gt"] = gt
2086
+ if lte is not DEFAULT:
2087
+ kwargs["lte"] = lte
2088
+ if lt is not DEFAULT:
2089
+ kwargs["lt"] = lt
2090
+ if use_field is not DEFAULT:
2091
+ kwargs["use_field"] = str(use_field)
2092
+ super().__init__(kwargs)
2093
+
2094
+
2095
+ class IntervalsRegexp(AttrDict[Any]):
2096
+ """
2097
+ :arg pattern: (required) Regex pattern.
2098
+ :arg analyzer: Analyzer used to analyze the `prefix`.
2099
+ :arg use_field: If specified, match intervals from this field rather
2100
+ than the top-level field. The `prefix` is normalized using the
2101
+ search analyzer from this field, unless `analyzer` is specified
2102
+ separately.
2103
+ """
2104
+
2105
+ pattern: Union[str, DefaultType]
2106
+ analyzer: Union[str, DefaultType]
2107
+ use_field: Union[str, InstrumentedField, DefaultType]
2108
+
2109
+ def __init__(
2110
+ self,
2111
+ *,
2112
+ pattern: Union[str, DefaultType] = DEFAULT,
2113
+ analyzer: Union[str, DefaultType] = DEFAULT,
2114
+ use_field: Union[str, InstrumentedField, DefaultType] = DEFAULT,
2115
+ **kwargs: Any,
2116
+ ):
2117
+ if pattern is not DEFAULT:
2118
+ kwargs["pattern"] = pattern
2119
+ if analyzer is not DEFAULT:
2120
+ kwargs["analyzer"] = analyzer
2121
+ if use_field is not DEFAULT:
2122
+ kwargs["use_field"] = str(use_field)
2123
+ super().__init__(kwargs)
2124
+
2125
+
2037
2126
  class IntervalsWildcard(AttrDict[Any]):
2038
2127
  """
2039
2128
  :arg pattern: (required) Wildcard pattern used to find matching terms.
@@ -4740,7 +4829,7 @@ class ErrorCause(AttrDict[Any]):
4740
4829
  """
4741
4830
 
4742
4831
  type: str
4743
- reason: str
4832
+ reason: Union[str, None]
4744
4833
  stack_trace: str
4745
4834
  caused_by: "ErrorCause"
4746
4835
  root_cause: Sequence["ErrorCause"]
@@ -4956,9 +5045,11 @@ class FiltersAggregate(AttrDict[Any]):
4956
5045
  class FiltersBucket(AttrDict[Any]):
4957
5046
  """
4958
5047
  :arg doc_count: (required)
5048
+ :arg key:
4959
5049
  """
4960
5050
 
4961
5051
  doc_count: int
5052
+ key: str
4962
5053
 
4963
5054
 
4964
5055
  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