elasticsearch9 9.2.0__py3-none-any.whl → 9.2.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.
Files changed (120) hide show
  1. elasticsearch9/_async/client/__init__.py +64 -45
  2. elasticsearch9/_async/client/async_search.py +3 -3
  3. elasticsearch9/_async/client/autoscaling.py +15 -4
  4. elasticsearch9/_async/client/cat.py +40 -2
  5. elasticsearch9/_async/client/ccr.py +10 -10
  6. elasticsearch9/_async/client/cluster.py +32 -32
  7. elasticsearch9/_async/client/connector.py +42 -41
  8. elasticsearch9/_async/client/dangling_indices.py +8 -12
  9. elasticsearch9/_async/client/enrich.py +10 -10
  10. elasticsearch9/_async/client/eql.py +10 -10
  11. elasticsearch9/_async/client/esql.py +16 -16
  12. elasticsearch9/_async/client/features.py +6 -6
  13. elasticsearch9/_async/client/fleet.py +7 -7
  14. elasticsearch9/_async/client/graph.py +2 -2
  15. elasticsearch9/_async/client/ilm.py +18 -18
  16. elasticsearch9/_async/client/indices.py +131 -135
  17. elasticsearch9/_async/client/inference.py +76 -56
  18. elasticsearch9/_async/client/ingest.py +9 -9
  19. elasticsearch9/_async/client/license.py +5 -7
  20. elasticsearch9/_async/client/logstash.py +4 -4
  21. elasticsearch9/_async/client/migration.py +6 -6
  22. elasticsearch9/_async/client/ml.py +125 -85
  23. elasticsearch9/_async/client/monitoring.py +4 -3
  24. elasticsearch9/_async/client/nodes.py +15 -15
  25. elasticsearch9/_async/client/project.py +4 -3
  26. elasticsearch9/_async/client/query_rules.py +16 -16
  27. elasticsearch9/_async/client/rollup.py +21 -21
  28. elasticsearch9/_async/client/search_application.py +19 -19
  29. elasticsearch9/_async/client/searchable_snapshots.py +10 -10
  30. elasticsearch9/_async/client/security.py +8 -7
  31. elasticsearch9/_async/client/shutdown.py +15 -4
  32. elasticsearch9/_async/client/simulate.py +4 -4
  33. elasticsearch9/_async/client/slm.py +17 -17
  34. elasticsearch9/_async/client/snapshot.py +20 -20
  35. elasticsearch9/_async/client/sql.py +10 -10
  36. elasticsearch9/_async/client/streams.py +6 -6
  37. elasticsearch9/_async/client/synonyms.py +10 -10
  38. elasticsearch9/_async/client/tasks.py +8 -8
  39. elasticsearch9/_async/client/text_structure.py +13 -9
  40. elasticsearch9/_async/client/transform.py +51 -12
  41. elasticsearch9/_async/client/utils.py +4 -2
  42. elasticsearch9/_async/client/watcher.py +26 -26
  43. elasticsearch9/_async/client/xpack.py +6 -5
  44. elasticsearch9/_sync/client/__init__.py +66 -45
  45. elasticsearch9/_sync/client/async_search.py +3 -3
  46. elasticsearch9/_sync/client/autoscaling.py +15 -4
  47. elasticsearch9/_sync/client/cat.py +40 -2
  48. elasticsearch9/_sync/client/ccr.py +10 -10
  49. elasticsearch9/_sync/client/cluster.py +32 -32
  50. elasticsearch9/_sync/client/connector.py +42 -41
  51. elasticsearch9/_sync/client/dangling_indices.py +8 -12
  52. elasticsearch9/_sync/client/enrich.py +10 -10
  53. elasticsearch9/_sync/client/eql.py +10 -10
  54. elasticsearch9/_sync/client/esql.py +16 -16
  55. elasticsearch9/_sync/client/features.py +6 -6
  56. elasticsearch9/_sync/client/fleet.py +7 -7
  57. elasticsearch9/_sync/client/graph.py +2 -2
  58. elasticsearch9/_sync/client/ilm.py +18 -18
  59. elasticsearch9/_sync/client/indices.py +131 -135
  60. elasticsearch9/_sync/client/inference.py +76 -56
  61. elasticsearch9/_sync/client/ingest.py +9 -9
  62. elasticsearch9/_sync/client/license.py +5 -7
  63. elasticsearch9/_sync/client/logstash.py +4 -4
  64. elasticsearch9/_sync/client/migration.py +6 -6
  65. elasticsearch9/_sync/client/ml.py +125 -85
  66. elasticsearch9/_sync/client/monitoring.py +4 -3
  67. elasticsearch9/_sync/client/nodes.py +15 -15
  68. elasticsearch9/_sync/client/project.py +4 -3
  69. elasticsearch9/_sync/client/query_rules.py +16 -16
  70. elasticsearch9/_sync/client/rollup.py +21 -21
  71. elasticsearch9/_sync/client/search_application.py +19 -19
  72. elasticsearch9/_sync/client/searchable_snapshots.py +10 -10
  73. elasticsearch9/_sync/client/security.py +8 -7
  74. elasticsearch9/_sync/client/shutdown.py +15 -4
  75. elasticsearch9/_sync/client/simulate.py +4 -4
  76. elasticsearch9/_sync/client/slm.py +17 -17
  77. elasticsearch9/_sync/client/snapshot.py +20 -20
  78. elasticsearch9/_sync/client/sql.py +10 -10
  79. elasticsearch9/_sync/client/streams.py +6 -6
  80. elasticsearch9/_sync/client/synonyms.py +10 -10
  81. elasticsearch9/_sync/client/tasks.py +8 -8
  82. elasticsearch9/_sync/client/text_structure.py +13 -9
  83. elasticsearch9/_sync/client/transform.py +51 -12
  84. elasticsearch9/_sync/client/utils.py +16 -2
  85. elasticsearch9/_sync/client/watcher.py +26 -26
  86. elasticsearch9/_sync/client/xpack.py +6 -5
  87. elasticsearch9/_version.py +2 -2
  88. elasticsearch9/dsl/_async/document.py +4 -5
  89. elasticsearch9/dsl/_async/index.py +1 -1
  90. elasticsearch9/dsl/_async/search.py +2 -3
  91. elasticsearch9/dsl/_sync/document.py +4 -5
  92. elasticsearch9/dsl/_sync/index.py +1 -1
  93. elasticsearch9/dsl/_sync/search.py +2 -3
  94. elasticsearch9/dsl/aggs.py +3 -3
  95. elasticsearch9/dsl/async_connections.py +1 -2
  96. elasticsearch9/dsl/connections.py +1 -2
  97. elasticsearch9/dsl/document_base.py +1 -1
  98. elasticsearch9/dsl/field.py +1 -1
  99. elasticsearch9/dsl/pydantic.py +1 -1
  100. elasticsearch9/dsl/query.py +23 -0
  101. elasticsearch9/dsl/serializer.py +1 -2
  102. elasticsearch9/dsl/types.py +2 -6
  103. elasticsearch9/dsl/utils.py +1 -2
  104. elasticsearch9/esql/esql.py +1 -1
  105. elasticsearch9/esql/functions.py +2 -2
  106. elasticsearch9/helpers/vectorstore/__init__.py +7 -7
  107. elasticsearch9/helpers/vectorstore/_async/_utils.py +1 -1
  108. elasticsearch9/helpers/vectorstore/_async/embedding_service.py +2 -2
  109. elasticsearch9/helpers/vectorstore/_async/strategies.py +3 -3
  110. elasticsearch9/helpers/vectorstore/_async/vectorstore.py +5 -5
  111. elasticsearch9/helpers/vectorstore/_sync/_utils.py +1 -1
  112. elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +2 -2
  113. elasticsearch9/helpers/vectorstore/_sync/strategies.py +3 -3
  114. elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +5 -5
  115. {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.2.1.dist-info}/METADATA +1 -1
  116. elasticsearch9-9.2.1.dist-info/RECORD +168 -0
  117. {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.2.1.dist-info}/WHEEL +1 -1
  118. elasticsearch9-9.2.0.dist-info/RECORD +0 -168
  119. {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.2.1.dist-info}/licenses/LICENSE +0 -0
  120. {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.2.1.dist-info}/licenses/NOTICE +0 -0
@@ -79,6 +79,12 @@ class Stability(Enum):
79
79
  EXPERIMENTAL = auto()
80
80
 
81
81
 
82
+ class Visibility(Enum):
83
+ PUBLIC = auto()
84
+ FEATURE_FLAG = auto()
85
+ PRIVATE = auto()
86
+
87
+
82
88
  _TYPE_HOSTS = Union[
83
89
  str, Sequence[Union[str, Mapping[str, Union[str, int]], NodeConfig]]
84
90
  ]
@@ -419,15 +425,23 @@ def _rewrite_parameters(
419
425
  return wrapper
420
426
 
421
427
 
422
- def _stability_warning(
428
+ def _availability_warning(
423
429
  stability: Stability,
430
+ visibility: Visibility = Visibility.PUBLIC,
424
431
  version: Optional[str] = None,
425
432
  message: Optional[str] = None,
426
433
  ) -> Callable[[F], F]:
427
434
  def wrapper(api: F) -> F:
428
435
  @wraps(api)
429
436
  def wrapped(*args: Any, **kwargs: Any) -> Any:
430
- if stability == Stability.BETA:
437
+ if visibility == Visibility.PRIVATE:
438
+ warnings.warn(
439
+ "This API is private. "
440
+ "Private APIs are not subject to the support SLA of official GA features.",
441
+ category=GeneralAvailabilityWarning,
442
+ stacklevel=warn_stacklevel(),
443
+ )
444
+ elif stability == Stability.BETA:
431
445
  warnings.warn(
432
446
  "This API is in beta and is subject to change. "
433
447
  "The design and code is less mature than official GA features and is being provided as-is with no warranties. "
@@ -39,8 +39,8 @@ class WatcherClient(NamespacedClient):
39
39
  """
40
40
  .. raw:: html
41
41
 
42
- <p>Acknowledge a watch.
43
- Acknowledging a watch enables you to manually throttle the execution of the watch's actions.</p>
42
+ <p>Acknowledge a watch.</p>
43
+ <p>Acknowledging a watch enables you to manually throttle the execution of the watch's actions.</p>
44
44
  <p>The acknowledgement state of an action is stored in the <code>status.actions.&lt;id&gt;.ack.state</code> structure.</p>
45
45
  <p>IMPORTANT: If the specified watch is currently being executed, this API will return an error
46
46
  The reason for this behavior is to prevent overwriting the watch status from a watch execution.</p>
@@ -101,8 +101,8 @@ class WatcherClient(NamespacedClient):
101
101
  """
102
102
  .. raw:: html
103
103
 
104
- <p>Activate a watch.
105
- A watch can be either active or inactive.</p>
104
+ <p>Activate a watch.</p>
105
+ <p>A watch can be either active or inactive.</p>
106
106
 
107
107
 
108
108
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-activate-watch>`_
@@ -145,8 +145,8 @@ class WatcherClient(NamespacedClient):
145
145
  """
146
146
  .. raw:: html
147
147
 
148
- <p>Deactivate a watch.
149
- A watch can be either active or inactive.</p>
148
+ <p>Deactivate a watch.</p>
149
+ <p>A watch can be either active or inactive.</p>
150
150
 
151
151
 
152
152
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-deactivate-watch>`_
@@ -189,8 +189,8 @@ class WatcherClient(NamespacedClient):
189
189
  """
190
190
  .. raw:: html
191
191
 
192
- <p>Delete a watch.
193
- When the watch is removed, the document representing the watch in the <code>.watches</code> index is gone and it will never be run again.</p>
192
+ <p>Delete a watch.</p>
193
+ <p>When the watch is removed, the document representing the watch in the <code>.watches</code> index is gone and it will never be run again.</p>
194
194
  <p>Deleting a watch does not delete any watch execution records related to this watch from the watch history.</p>
195
195
  <p>IMPORTANT: Deleting a watch must be done by using only this API.
196
196
  Do not delete the watch directly from the <code>.watches</code> index using the Elasticsearch delete document API
@@ -266,8 +266,8 @@ class WatcherClient(NamespacedClient):
266
266
  """
267
267
  .. raw:: html
268
268
 
269
- <p>Run a watch.
270
- This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.</p>
269
+ <p>Run a watch.</p>
270
+ <p>This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.</p>
271
271
  <p>For testing and debugging purposes, you also have fine-grained control on how the watch runs.
272
272
  You can run the watch without running all of its actions or alternatively by simulating them.
273
273
  You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after it runs.</p>
@@ -362,8 +362,8 @@ class WatcherClient(NamespacedClient):
362
362
  """
363
363
  .. raw:: html
364
364
 
365
- <p>Get Watcher index settings.
366
- Get settings for the Watcher internal index (<code>.watches</code>).
365
+ <p>Get Watcher index settings.</p>
366
+ <p>Get settings for the Watcher internal index (<code>.watches</code>).
367
367
  Only a subset of settings are shown, for example <code>index.auto_expand_replicas</code> and <code>index.number_of_replicas</code>.</p>
368
368
 
369
369
 
@@ -476,8 +476,8 @@ class WatcherClient(NamespacedClient):
476
476
  """
477
477
  .. raw:: html
478
478
 
479
- <p>Create or update a watch.
480
- When a watch is registered, a new document that represents the watch is added to the <code>.watches</code> index and its trigger is immediately registered with the relevant trigger engine.
479
+ <p>Create or update a watch.</p>
480
+ <p>When a watch is registered, a new document that represents the watch is added to the <code>.watches</code> index and its trigger is immediately registered with the relevant trigger engine.
481
481
  Typically for the <code>schedule</code> trigger, the scheduler is the trigger engine.</p>
482
482
  <p>IMPORTANT: You must use Kibana or this API to create a watch.
483
483
  Do not add a watch directly to the <code>.watches</code> index by using the Elasticsearch index API.
@@ -494,9 +494,9 @@ class WatcherClient(NamespacedClient):
494
494
  :param active: The initial state of the watch. The default value is `true`, which
495
495
  means the watch is active by default.
496
496
  :param condition: The condition that defines if the actions should be run.
497
- :param if_primary_term: only update the watch if the last operation that has
497
+ :param if_primary_term: Only update the watch if the last operation that has
498
498
  changed the watch has the specified primary term
499
- :param if_seq_no: only update the watch if the last operation that has changed
499
+ :param if_seq_no: Only update the watch if the last operation that has changed
500
500
  the watch has the specified sequence number
501
501
  :param input: The input that defines the input that loads the data for the watch.
502
502
  :param metadata: Metadata JSON that will be copied into the history entries.
@@ -591,8 +591,8 @@ class WatcherClient(NamespacedClient):
591
591
  """
592
592
  .. raw:: html
593
593
 
594
- <p>Query watches.
595
- Get all registered watches in a paginated manner and optionally filter watches by a query.</p>
594
+ <p>Query watches.</p>
595
+ <p>Get all registered watches in a paginated manner and optionally filter watches by a query.</p>
596
596
  <p>Note that only the <code>_id</code> and <code>metadata.*</code> fields are queryable or sortable.</p>
597
597
 
598
598
 
@@ -667,8 +667,8 @@ class WatcherClient(NamespacedClient):
667
667
  """
668
668
  .. raw:: html
669
669
 
670
- <p>Start the watch service.
671
- Start the Watcher service if it is not already running.</p>
670
+ <p>Start the watch service.</p>
671
+ <p>Start the Watcher service if it is not already running.</p>
672
672
 
673
673
 
674
674
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-start>`_
@@ -732,8 +732,8 @@ class WatcherClient(NamespacedClient):
732
732
  """
733
733
  .. raw:: html
734
734
 
735
- <p>Get Watcher statistics.
736
- This API always returns basic metrics.
735
+ <p>Get Watcher statistics.</p>
736
+ <p>This API always returns basic metrics.
737
737
  You retrieve more metrics by using the metric parameter.</p>
738
738
 
739
739
 
@@ -784,8 +784,8 @@ class WatcherClient(NamespacedClient):
784
784
  """
785
785
  .. raw:: html
786
786
 
787
- <p>Stop the watch service.
788
- Stop the Watcher service if it is running.</p>
787
+ <p>Stop the watch service.</p>
788
+ <p>Stop the Watcher service if it is running.</p>
789
789
 
790
790
 
791
791
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stop>`_
@@ -840,8 +840,8 @@ class WatcherClient(NamespacedClient):
840
840
  """
841
841
  .. raw:: html
842
842
 
843
- <p>Update Watcher index settings.
844
- Update settings for the Watcher internal index (<code>.watches</code>).
843
+ <p>Update Watcher index settings.</p>
844
+ <p>Update settings for the Watcher internal index (<code>.watches</code>).
845
845
  Only a subset of settings can be modified.
846
846
  This includes <code>index.auto_expand_replicas</code>, <code>index.number_of_replicas</code>, <code>index.routing.allocation.exclude.*</code>,
847
847
  <code>index.routing.allocation.include.*</code> and <code>index.routing.allocation.require.*</code>.
@@ -45,8 +45,8 @@ class XPackClient(NamespacedClient):
45
45
  """
46
46
  .. raw:: html
47
47
 
48
- <p>Get information.
49
- The information provided by the API includes:</p>
48
+ <p>Get information.</p>
49
+ <p>The information provided by the API includes:</p>
50
50
  <ul>
51
51
  <li>Build information including the build number and timestamp.</li>
52
52
  <li>License information about the currently installed license.</li>
@@ -56,7 +56,8 @@ class XPackClient(NamespacedClient):
56
56
 
57
57
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-info>`_
58
58
 
59
- :param accept_enterprise: If this param is used it must be set to true
59
+ :param accept_enterprise: If used, this otherwise ignored parameter must be set
60
+ to true
60
61
  :param categories: A comma-separated list of the information categories to include
61
62
  in the response. For example, `build,license,features`.
62
63
  """
@@ -98,8 +99,8 @@ class XPackClient(NamespacedClient):
98
99
  """
99
100
  .. raw:: html
100
101
 
101
- <p>Get usage information.
102
- Get information about the features that are currently enabled and available under the current license.
102
+ <p>Get usage information.</p>
103
+ <p>Get information about the features that are currently enabled and available under the current license.
103
104
  The API also provides some usage statistics.</p>
104
105
 
105
106
 
@@ -15,5 +15,5 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
- __versionstr__ = "9.2.0"
19
- __es_specification_commit__ = "2f74c26e0a1d66c42232ce2830652c01e8717f00"
18
+ __versionstr__ = "9.2.1"
19
+ __es_specification_commit__ = "4ab58cf013706c9104d18daafae4361cf7351a55"
@@ -31,9 +31,8 @@ from typing import (
31
31
 
32
32
  from typing_extensions import Self, dataclass_transform
33
33
 
34
- from elasticsearch.exceptions import NotFoundError, RequestError
35
- from elasticsearch.helpers import async_bulk
36
-
34
+ from ...exceptions import NotFoundError, RequestError
35
+ from ...helpers import async_bulk
37
36
  from .._async.index import AsyncIndex
38
37
  from ..async_connections import get_connection
39
38
  from ..document_base import DocumentBase, DocumentMeta, mapped_field
@@ -42,8 +41,8 @@ from ..utils import DOC_META_FIELDS, META_FIELDS, AsyncUsingType, merge
42
41
  from .search import AsyncSearch
43
42
 
44
43
  if TYPE_CHECKING:
45
- from elasticsearch import AsyncElasticsearch
46
- from elasticsearch.esql.esql import ESQLBase
44
+ from ... import AsyncElasticsearch
45
+ from ...esql.esql import ESQLBase
47
46
 
48
47
 
49
48
  class AsyncIndexMeta(DocumentMeta):
@@ -30,7 +30,7 @@ from .update_by_query import AsyncUpdateByQuery
30
30
  if TYPE_CHECKING:
31
31
  from elastic_transport import ObjectApiResponse
32
32
 
33
- from elasticsearch import AsyncElasticsearch
33
+ from ... import AsyncElasticsearch
34
34
 
35
35
 
36
36
  class AsyncIndexTemplate:
@@ -29,9 +29,8 @@ from typing import (
29
29
 
30
30
  from typing_extensions import Self
31
31
 
32
- from elasticsearch.exceptions import ApiError
33
- from elasticsearch.helpers import async_scan
34
-
32
+ from ...exceptions import ApiError
33
+ from ...helpers import async_scan
35
34
  from ..async_connections import get_connection
36
35
  from ..response import Response
37
36
  from ..search_base import MultiSearchBase, SearchBase
@@ -31,9 +31,8 @@ from typing import (
31
31
 
32
32
  from typing_extensions import Self, dataclass_transform
33
33
 
34
- from elasticsearch.exceptions import NotFoundError, RequestError
35
- from elasticsearch.helpers import bulk
36
-
34
+ from ...exceptions import NotFoundError, RequestError
35
+ from ...helpers import bulk
37
36
  from .._sync.index import Index
38
37
  from ..connections import get_connection
39
38
  from ..document_base import DocumentBase, DocumentMeta, mapped_field
@@ -42,8 +41,8 @@ from ..utils import DOC_META_FIELDS, META_FIELDS, UsingType, merge
42
41
  from .search import Search
43
42
 
44
43
  if TYPE_CHECKING:
45
- from elasticsearch import Elasticsearch
46
- from elasticsearch.esql.esql import ESQLBase
44
+ from ... import Elasticsearch
45
+ from ...esql.esql import ESQLBase
47
46
 
48
47
 
49
48
  class IndexMeta(DocumentMeta):
@@ -30,7 +30,7 @@ from .update_by_query import UpdateByQuery
30
30
  if TYPE_CHECKING:
31
31
  from elastic_transport import ObjectApiResponse
32
32
 
33
- from elasticsearch import Elasticsearch
33
+ from ... import Elasticsearch
34
34
 
35
35
 
36
36
  class IndexTemplate:
@@ -28,9 +28,8 @@ from typing import (
28
28
 
29
29
  from typing_extensions import Self
30
30
 
31
- from elasticsearch.exceptions import ApiError
32
- from elasticsearch.helpers import scan
33
-
31
+ from ...exceptions import ApiError
32
+ from ...helpers import scan
34
33
  from ..connections import get_connection
35
34
  from ..response import Response
36
35
  from ..search_base import MultiSearchBase, SearchBase
@@ -1495,7 +1495,7 @@ class GeohashGrid(Bucket[_R]):
1495
1495
  "DefaultType",
1496
1496
  ] = DEFAULT,
1497
1497
  field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
1498
- precision: Union[float, str, "DefaultType"] = DEFAULT,
1498
+ precision: Union[int, str, "DefaultType"] = DEFAULT,
1499
1499
  shard_size: Union[int, "DefaultType"] = DEFAULT,
1500
1500
  size: Union[int, "DefaultType"] = DEFAULT,
1501
1501
  **kwargs: Any,
@@ -1579,7 +1579,7 @@ class GeotileGrid(Bucket[_R]):
1579
1579
  self,
1580
1580
  *,
1581
1581
  field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
1582
- precision: Union[float, "DefaultType"] = DEFAULT,
1582
+ precision: Union[int, "DefaultType"] = DEFAULT,
1583
1583
  shard_size: Union[int, "DefaultType"] = DEFAULT,
1584
1584
  size: Union[int, "DefaultType"] = DEFAULT,
1585
1585
  bounds: Union[
@@ -2680,7 +2680,7 @@ class Percentiles(Agg[_R]):
2680
2680
  self,
2681
2681
  *,
2682
2682
  keyed: Union[bool, "DefaultType"] = DEFAULT,
2683
- percents: Union[Sequence[float], "DefaultType"] = DEFAULT,
2683
+ percents: Union[float, Sequence[float], "DefaultType"] = DEFAULT,
2684
2684
  hdr: Union["types.HdrMethod", Dict[str, Any], "DefaultType"] = DEFAULT,
2685
2685
  tdigest: Union["types.TDigest", Dict[str, Any], "DefaultType"] = DEFAULT,
2686
2686
  format: Union[str, "DefaultType"] = DEFAULT,
@@ -17,8 +17,7 @@
17
17
 
18
18
  from typing import Type
19
19
 
20
- from elasticsearch import AsyncElasticsearch
21
-
20
+ from .. import AsyncElasticsearch
22
21
  from .connections import Connections
23
22
 
24
23
 
@@ -17,8 +17,7 @@
17
17
 
18
18
  from typing import Any, Dict, Generic, Type, TypeVar, Union
19
19
 
20
- from elasticsearch import Elasticsearch, __versionstr__
21
-
20
+ from .. import Elasticsearch, __versionstr__
22
21
  from .serializer import serializer
23
22
 
24
23
  _T = TypeVar("_T")
@@ -39,7 +39,7 @@ from typing_extensions import _AnnotatedAlias
39
39
  try:
40
40
  import annotationlib
41
41
  except ImportError:
42
- annotationlib = None
42
+ annotationlib = None # type: ignore[assignment]
43
43
 
44
44
  try:
45
45
  from types import UnionType
@@ -3892,7 +3892,7 @@ class SemanticText(Field):
3892
3892
  "types.SemanticTextIndexOptions", Dict[str, Any], "DefaultType"
3893
3893
  ] = DEFAULT,
3894
3894
  chunking_settings: Union[
3895
- "types.ChunkingSettings", None, Dict[str, Any], "DefaultType"
3895
+ "types.ChunkingSettings", Dict[str, Any], "DefaultType"
3896
3896
  ] = DEFAULT,
3897
3897
  fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3898
3898
  **kwargs: Any,
@@ -20,7 +20,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Tuple, Type
20
20
  from pydantic import BaseModel, Field, PrivateAttr
21
21
  from typing_extensions import Annotated, Self, dataclass_transform
22
22
 
23
- from elasticsearch import dsl
23
+ from .. import dsl
24
24
 
25
25
 
26
26
  class ESMeta(BaseModel):
@@ -370,6 +370,7 @@ class Common(Query):
370
370
  _value: Union[
371
371
  "types.CommonTermsQuery", Dict[str, Any], "DefaultType"
372
372
  ] = DEFAULT,
373
+ /,
373
374
  **kwargs: Any,
374
375
  ):
375
376
  if _field is not DEFAULT:
@@ -666,6 +667,7 @@ class Fuzzy(Query):
666
667
  self,
667
668
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
668
669
  _value: Union["types.FuzzyQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
670
+ /,
669
671
  **kwargs: Any,
670
672
  ):
671
673
  if _field is not DEFAULT:
@@ -708,6 +710,7 @@ class GeoBoundingBox(Query):
708
710
  Dict[str, Any],
709
711
  "DefaultType",
710
712
  ] = DEFAULT,
713
+ /,
711
714
  *,
712
715
  type: Union[Literal["memory", "indexed"], "DefaultType"] = DEFAULT,
713
716
  validation_method: Union[
@@ -771,6 +774,7 @@ class GeoDistance(Query):
771
774
  Dict[str, Any],
772
775
  "DefaultType",
773
776
  ] = DEFAULT,
777
+ /,
774
778
  *,
775
779
  distance: Union[str, "DefaultType"] = DEFAULT,
776
780
  distance_type: Union[Literal["arc", "plane"], "DefaultType"] = DEFAULT,
@@ -810,6 +814,7 @@ class GeoGrid(Query):
810
814
  self,
811
815
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
812
816
  _value: Union["types.GeoGridQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
817
+ /,
813
818
  **kwargs: Any,
814
819
  ):
815
820
  if _field is not DEFAULT:
@@ -839,6 +844,7 @@ class GeoPolygon(Query):
839
844
  _value: Union[
840
845
  "types.GeoPolygonPoints", Dict[str, Any], "DefaultType"
841
846
  ] = DEFAULT,
847
+ /,
842
848
  *,
843
849
  validation_method: Union[
844
850
  Literal["coerce", "ignore_malformed", "strict"], "DefaultType"
@@ -885,6 +891,7 @@ class GeoShape(Query):
885
891
  _value: Union[
886
892
  "types.GeoShapeFieldQuery", Dict[str, Any], "DefaultType"
887
893
  ] = DEFAULT,
894
+ /,
888
895
  *,
889
896
  ignore_unmapped: Union[bool, "DefaultType"] = DEFAULT,
890
897
  boost: Union[float, "DefaultType"] = DEFAULT,
@@ -1060,6 +1067,7 @@ class Intervals(Query):
1060
1067
  self,
1061
1068
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
1062
1069
  _value: Union["types.IntervalsQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
1070
+ /,
1063
1071
  **kwargs: Any,
1064
1072
  ):
1065
1073
  if _field is not DEFAULT:
@@ -1151,6 +1159,7 @@ class Match(Query):
1151
1159
  self,
1152
1160
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
1153
1161
  _value: Union["types.MatchQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
1162
+ /,
1154
1163
  **kwargs: Any,
1155
1164
  ):
1156
1165
  if _field is not DEFAULT:
@@ -1216,6 +1225,7 @@ class MatchBoolPrefix(Query):
1216
1225
  _value: Union[
1217
1226
  "types.MatchBoolPrefixQuery", Dict[str, Any], "DefaultType"
1218
1227
  ] = DEFAULT,
1228
+ /,
1219
1229
  **kwargs: Any,
1220
1230
  ):
1221
1231
  if _field is not DEFAULT:
@@ -1276,6 +1286,7 @@ class MatchPhrase(Query):
1276
1286
  _value: Union[
1277
1287
  "types.MatchPhraseQuery", Dict[str, Any], "DefaultType"
1278
1288
  ] = DEFAULT,
1289
+ /,
1279
1290
  **kwargs: Any,
1280
1291
  ):
1281
1292
  if _field is not DEFAULT:
@@ -1301,6 +1312,7 @@ class MatchPhrasePrefix(Query):
1301
1312
  _value: Union[
1302
1313
  "types.MatchPhrasePrefixQuery", Dict[str, Any], "DefaultType"
1303
1314
  ] = DEFAULT,
1315
+ /,
1304
1316
  **kwargs: Any,
1305
1317
  ):
1306
1318
  if _field is not DEFAULT:
@@ -1784,6 +1796,7 @@ class Prefix(Query):
1784
1796
  self,
1785
1797
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
1786
1798
  _value: Union["types.PrefixQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
1799
+ /,
1787
1800
  **kwargs: Any,
1788
1801
  ):
1789
1802
  if _field is not DEFAULT:
@@ -1950,6 +1963,7 @@ class Range(Query):
1950
1963
  self,
1951
1964
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
1952
1965
  _value: Union["wrappers.Range[Any]", Dict[str, Any], "DefaultType"] = DEFAULT,
1966
+ /,
1953
1967
  **kwargs: Any,
1954
1968
  ):
1955
1969
  if _field is not DEFAULT:
@@ -2028,6 +2042,7 @@ class Regexp(Query):
2028
2042
  self,
2029
2043
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
2030
2044
  _value: Union["types.RegexpQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
2045
+ /,
2031
2046
  **kwargs: Any,
2032
2047
  ):
2033
2048
  if _field is not DEFAULT:
@@ -2198,6 +2213,7 @@ class Shape(Query):
2198
2213
  self,
2199
2214
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
2200
2215
  _value: Union["types.ShapeFieldQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
2216
+ /,
2201
2217
  *,
2202
2218
  ignore_unmapped: Union[bool, "DefaultType"] = DEFAULT,
2203
2219
  boost: Union[float, "DefaultType"] = DEFAULT,
@@ -2556,6 +2572,7 @@ class SpanTerm(Query):
2556
2572
  self,
2557
2573
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
2558
2574
  _value: Union["types.SpanTermQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
2575
+ /,
2559
2576
  **kwargs: Any,
2560
2577
  ):
2561
2578
  if _field is not DEFAULT:
@@ -2676,6 +2693,7 @@ class Term(Query):
2676
2693
  self,
2677
2694
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
2678
2695
  _value: Union["types.TermQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
2696
+ /,
2679
2697
  **kwargs: Any,
2680
2698
  ):
2681
2699
  if _field is not DEFAULT:
@@ -2710,6 +2728,7 @@ class Terms(Query):
2710
2728
  Dict[str, Any],
2711
2729
  "DefaultType",
2712
2730
  ] = DEFAULT,
2731
+ /,
2713
2732
  *,
2714
2733
  boost: Union[float, "DefaultType"] = DEFAULT,
2715
2734
  _name: Union[str, "DefaultType"] = DEFAULT,
@@ -2743,6 +2762,7 @@ class TermsSet(Query):
2743
2762
  self,
2744
2763
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
2745
2764
  _value: Union["types.TermsSetQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
2765
+ /,
2746
2766
  **kwargs: Any,
2747
2767
  ):
2748
2768
  if _field is not DEFAULT:
@@ -2768,6 +2788,7 @@ class TextExpansion(Query):
2768
2788
  _value: Union[
2769
2789
  "types.TextExpansionQuery", Dict[str, Any], "DefaultType"
2770
2790
  ] = DEFAULT,
2791
+ /,
2771
2792
  **kwargs: Any,
2772
2793
  ):
2773
2794
  if _field is not DEFAULT:
@@ -2792,6 +2813,7 @@ class WeightedTokens(Query):
2792
2813
  _value: Union[
2793
2814
  "types.WeightedTokensQuery", Dict[str, Any], "DefaultType"
2794
2815
  ] = DEFAULT,
2816
+ /,
2795
2817
  **kwargs: Any,
2796
2818
  ):
2797
2819
  if _field is not DEFAULT:
@@ -2813,6 +2835,7 @@ class Wildcard(Query):
2813
2835
  self,
2814
2836
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
2815
2837
  _value: Union["types.WildcardQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
2838
+ /,
2816
2839
  **kwargs: Any,
2817
2840
  ):
2818
2841
  if _field is not DEFAULT:
@@ -17,8 +17,7 @@
17
17
 
18
18
  from typing import Any
19
19
 
20
- from elasticsearch.serializer import JSONSerializer
21
-
20
+ from ..serializer import JSONSerializer
22
21
  from .utils import AttrList
23
22
 
24
23
 
@@ -400,8 +400,6 @@ class DenseVectorIndexOptions(AttrDict[Any]):
400
400
  :arg rescore_vector: The rescore vector options. This is only
401
401
  applicable to `bbq_disk`, `bbq_hnsw`, `int4_hnsw`, `int8_hnsw`,
402
402
  `bbq_flat`, `int4_flat`, and `int8_flat` index types.
403
- :arg on_disk_rescore: `true` if vector rescoring should be done on-
404
- disk Only applicable to `bbq_hnsw`
405
403
  """
406
404
 
407
405
  type: Union[
@@ -424,7 +422,6 @@ class DenseVectorIndexOptions(AttrDict[Any]):
424
422
  rescore_vector: Union[
425
423
  "DenseVectorIndexOptionsRescoreVector", Dict[str, Any], DefaultType
426
424
  ]
427
- on_disk_rescore: Union[bool, DefaultType]
428
425
 
429
426
  def __init__(
430
427
  self,
@@ -449,7 +446,6 @@ class DenseVectorIndexOptions(AttrDict[Any]):
449
446
  rescore_vector: Union[
450
447
  "DenseVectorIndexOptionsRescoreVector", Dict[str, Any], DefaultType
451
448
  ] = DEFAULT,
452
- on_disk_rescore: Union[bool, DefaultType] = DEFAULT,
453
449
  **kwargs: Any,
454
450
  ):
455
451
  if type is not DEFAULT:
@@ -462,8 +458,6 @@ class DenseVectorIndexOptions(AttrDict[Any]):
462
458
  kwargs["m"] = m
463
459
  if rescore_vector is not DEFAULT:
464
460
  kwargs["rescore_vector"] = rescore_vector
465
- if on_disk_rescore is not DEFAULT:
466
- kwargs["on_disk_rescore"] = on_disk_rescore
467
461
  super().__init__(kwargs)
468
462
 
469
463
 
@@ -947,6 +941,7 @@ class GeoDistanceSort(AttrDict[Any]):
947
941
  Dict[str, Any],
948
942
  "DefaultType",
949
943
  ] = DEFAULT,
944
+ /,
950
945
  *,
951
946
  mode: Union[
952
947
  Literal["min", "max", "sum", "avg", "median"], DefaultType
@@ -3278,6 +3273,7 @@ class SortOptions(AttrDict[Any]):
3278
3273
  self,
3279
3274
  _field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
3280
3275
  _value: Union["FieldSort", Dict[str, Any], "DefaultType"] = DEFAULT,
3276
+ /,
3281
3277
  *,
3282
3278
  _score: Union["ScoreSort", Dict[str, Any], DefaultType] = DEFAULT,
3283
3279
  _doc: Union["ScoreSort", Dict[str, Any], DefaultType] = DEFAULT,
@@ -44,8 +44,7 @@ from .exceptions import UnknownDslObject, ValidationException
44
44
  if TYPE_CHECKING:
45
45
  from elastic_transport import ObjectApiResponse
46
46
 
47
- from elasticsearch import AsyncElasticsearch, Elasticsearch
48
-
47
+ from .. import AsyncElasticsearch, Elasticsearch
49
48
  from .document_base import DocumentOptions
50
49
  from .field import Field
51
50
  from .index_base import IndexBase
@@ -140,7 +140,7 @@ class ESQLBase(ABC):
140
140
  if re.fullmatch(r"[a-zA-Z_@][a-zA-Z0-9_\.]*", s):
141
141
  return s
142
142
  # this identifier needs to be escaped
143
- s.replace("`", "``")
143
+ s = s.replace("`", "``")
144
144
  return f"`{s}`"
145
145
 
146
146
  @staticmethod
@@ -18,8 +18,8 @@
18
18
  import json
19
19
  from typing import Any
20
20
 
21
- from elasticsearch.dsl.document_base import InstrumentedExpression
22
- from elasticsearch.esql.esql import ESQLBase, ExpressionType
21
+ from ..dsl.document_base import InstrumentedExpression
22
+ from ..esql.esql import ESQLBase, ExpressionType
23
23
 
24
24
 
25
25
  def _render(v: Any) -> str: