elasticsearch 8.17.2__py3-none-any.whl → 8.18.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 (135) hide show
  1. elasticsearch/_async/client/__init__.py +174 -79
  2. elasticsearch/_async/client/_base.py +0 -1
  3. elasticsearch/_async/client/async_search.py +12 -8
  4. elasticsearch/_async/client/autoscaling.py +4 -4
  5. elasticsearch/_async/client/cat.py +26 -26
  6. elasticsearch/_async/client/ccr.py +186 -72
  7. elasticsearch/_async/client/cluster.py +38 -19
  8. elasticsearch/_async/client/connector.py +30 -30
  9. elasticsearch/_async/client/dangling_indices.py +3 -3
  10. elasticsearch/_async/client/enrich.py +26 -5
  11. elasticsearch/_async/client/eql.py +32 -4
  12. elasticsearch/_async/client/esql.py +62 -6
  13. elasticsearch/_async/client/features.py +12 -2
  14. elasticsearch/_async/client/fleet.py +8 -2
  15. elasticsearch/_async/client/graph.py +1 -1
  16. elasticsearch/_async/client/ilm.py +23 -22
  17. elasticsearch/_async/client/indices.py +424 -132
  18. elasticsearch/_async/client/inference.py +1853 -115
  19. elasticsearch/_async/client/ingest.py +32 -38
  20. elasticsearch/_async/client/license.py +51 -16
  21. elasticsearch/_async/client/logstash.py +3 -3
  22. elasticsearch/_async/client/migration.py +3 -3
  23. elasticsearch/_async/client/ml.py +141 -112
  24. elasticsearch/_async/client/monitoring.py +1 -1
  25. elasticsearch/_async/client/nodes.py +9 -27
  26. elasticsearch/_async/client/query_rules.py +8 -8
  27. elasticsearch/_async/client/rollup.py +8 -8
  28. elasticsearch/_async/client/search_application.py +13 -13
  29. elasticsearch/_async/client/searchable_snapshots.py +4 -4
  30. elasticsearch/_async/client/security.py +71 -71
  31. elasticsearch/_async/client/shutdown.py +3 -10
  32. elasticsearch/_async/client/simulate.py +6 -6
  33. elasticsearch/_async/client/slm.py +9 -9
  34. elasticsearch/_async/client/snapshot.py +13 -17
  35. elasticsearch/_async/client/sql.py +6 -6
  36. elasticsearch/_async/client/ssl.py +1 -1
  37. elasticsearch/_async/client/synonyms.py +7 -7
  38. elasticsearch/_async/client/tasks.py +3 -9
  39. elasticsearch/_async/client/text_structure.py +4 -4
  40. elasticsearch/_async/client/transform.py +30 -28
  41. elasticsearch/_async/client/watcher.py +22 -14
  42. elasticsearch/_async/client/xpack.py +2 -2
  43. elasticsearch/_async/helpers.py +0 -1
  44. elasticsearch/_sync/client/__init__.py +174 -79
  45. elasticsearch/_sync/client/_base.py +0 -1
  46. elasticsearch/_sync/client/async_search.py +12 -8
  47. elasticsearch/_sync/client/autoscaling.py +4 -4
  48. elasticsearch/_sync/client/cat.py +26 -26
  49. elasticsearch/_sync/client/ccr.py +186 -72
  50. elasticsearch/_sync/client/cluster.py +38 -19
  51. elasticsearch/_sync/client/connector.py +30 -30
  52. elasticsearch/_sync/client/dangling_indices.py +3 -3
  53. elasticsearch/_sync/client/enrich.py +26 -5
  54. elasticsearch/_sync/client/eql.py +32 -4
  55. elasticsearch/_sync/client/esql.py +62 -6
  56. elasticsearch/_sync/client/features.py +12 -2
  57. elasticsearch/_sync/client/fleet.py +8 -2
  58. elasticsearch/_sync/client/graph.py +1 -1
  59. elasticsearch/_sync/client/ilm.py +23 -22
  60. elasticsearch/_sync/client/indices.py +424 -132
  61. elasticsearch/_sync/client/inference.py +1853 -115
  62. elasticsearch/_sync/client/ingest.py +32 -38
  63. elasticsearch/_sync/client/license.py +51 -16
  64. elasticsearch/_sync/client/logstash.py +3 -3
  65. elasticsearch/_sync/client/migration.py +3 -3
  66. elasticsearch/_sync/client/ml.py +141 -112
  67. elasticsearch/_sync/client/monitoring.py +1 -1
  68. elasticsearch/_sync/client/nodes.py +9 -27
  69. elasticsearch/_sync/client/query_rules.py +8 -8
  70. elasticsearch/_sync/client/rollup.py +8 -8
  71. elasticsearch/_sync/client/search_application.py +13 -13
  72. elasticsearch/_sync/client/searchable_snapshots.py +4 -4
  73. elasticsearch/_sync/client/security.py +71 -71
  74. elasticsearch/_sync/client/shutdown.py +3 -10
  75. elasticsearch/_sync/client/simulate.py +6 -6
  76. elasticsearch/_sync/client/slm.py +9 -9
  77. elasticsearch/_sync/client/snapshot.py +13 -17
  78. elasticsearch/_sync/client/sql.py +6 -6
  79. elasticsearch/_sync/client/ssl.py +1 -1
  80. elasticsearch/_sync/client/synonyms.py +7 -7
  81. elasticsearch/_sync/client/tasks.py +3 -9
  82. elasticsearch/_sync/client/text_structure.py +4 -4
  83. elasticsearch/_sync/client/transform.py +30 -28
  84. elasticsearch/_sync/client/utils.py +0 -3
  85. elasticsearch/_sync/client/watcher.py +22 -14
  86. elasticsearch/_sync/client/xpack.py +2 -2
  87. elasticsearch/_version.py +1 -1
  88. elasticsearch/dsl/__init__.py +203 -0
  89. elasticsearch/dsl/_async/__init__.py +16 -0
  90. elasticsearch/dsl/_async/document.py +522 -0
  91. elasticsearch/dsl/_async/faceted_search.py +50 -0
  92. elasticsearch/dsl/_async/index.py +639 -0
  93. elasticsearch/dsl/_async/mapping.py +49 -0
  94. elasticsearch/dsl/_async/search.py +233 -0
  95. elasticsearch/dsl/_async/update_by_query.py +47 -0
  96. elasticsearch/dsl/_sync/__init__.py +16 -0
  97. elasticsearch/dsl/_sync/document.py +514 -0
  98. elasticsearch/dsl/_sync/faceted_search.py +50 -0
  99. elasticsearch/dsl/_sync/index.py +597 -0
  100. elasticsearch/dsl/_sync/mapping.py +49 -0
  101. elasticsearch/dsl/_sync/search.py +226 -0
  102. elasticsearch/dsl/_sync/update_by_query.py +45 -0
  103. elasticsearch/dsl/aggs.py +3730 -0
  104. elasticsearch/dsl/analysis.py +341 -0
  105. elasticsearch/dsl/async_connections.py +37 -0
  106. elasticsearch/dsl/connections.py +142 -0
  107. elasticsearch/dsl/document.py +20 -0
  108. elasticsearch/dsl/document_base.py +444 -0
  109. elasticsearch/dsl/exceptions.py +32 -0
  110. elasticsearch/dsl/faceted_search.py +28 -0
  111. elasticsearch/dsl/faceted_search_base.py +489 -0
  112. elasticsearch/dsl/field.py +4254 -0
  113. elasticsearch/dsl/function.py +180 -0
  114. elasticsearch/dsl/index.py +23 -0
  115. elasticsearch/dsl/index_base.py +178 -0
  116. elasticsearch/dsl/mapping.py +19 -0
  117. elasticsearch/dsl/mapping_base.py +219 -0
  118. elasticsearch/dsl/query.py +2816 -0
  119. elasticsearch/dsl/response/__init__.py +388 -0
  120. elasticsearch/dsl/response/aggs.py +100 -0
  121. elasticsearch/dsl/response/hit.py +53 -0
  122. elasticsearch/dsl/search.py +20 -0
  123. elasticsearch/dsl/search_base.py +1040 -0
  124. elasticsearch/dsl/serializer.py +34 -0
  125. elasticsearch/dsl/types.py +6471 -0
  126. elasticsearch/dsl/update_by_query.py +19 -0
  127. elasticsearch/dsl/update_by_query_base.py +149 -0
  128. elasticsearch/dsl/utils.py +687 -0
  129. elasticsearch/dsl/wrappers.py +119 -0
  130. {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.0.dist-info}/METADATA +12 -2
  131. elasticsearch-8.18.0.dist-info/RECORD +161 -0
  132. elasticsearch-8.17.2.dist-info/RECORD +0 -119
  133. {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.0.dist-info}/WHEEL +0 -0
  134. {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.0.dist-info}/licenses/LICENSE +0 -0
  135. {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.0.dist-info}/licenses/NOTICE +0 -0
@@ -0,0 +1,4254 @@
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
+ import base64
19
+ import collections.abc
20
+ import ipaddress
21
+ from copy import deepcopy
22
+ from datetime import date, datetime
23
+ from typing import (
24
+ TYPE_CHECKING,
25
+ Any,
26
+ Dict,
27
+ Iterable,
28
+ Iterator,
29
+ Literal,
30
+ Mapping,
31
+ Optional,
32
+ Sequence,
33
+ Tuple,
34
+ Type,
35
+ Union,
36
+ cast,
37
+ )
38
+
39
+ from dateutil import parser, tz
40
+ from elastic_transport.client_utils import DEFAULT, DefaultType
41
+
42
+ from .exceptions import ValidationException
43
+ from .query import Q
44
+ from .utils import AttrDict, AttrList, DslBase
45
+ from .wrappers import Range
46
+
47
+ if TYPE_CHECKING:
48
+ from datetime import tzinfo
49
+ from ipaddress import IPv4Address, IPv6Address
50
+
51
+ from _operator import _SupportsComparison
52
+
53
+ from . import types
54
+ from .document import InnerDoc
55
+ from .document_base import InstrumentedField
56
+ from .mapping_base import MappingBase
57
+ from .query import Query
58
+
59
+ unicode = str
60
+
61
+
62
+ def construct_field(
63
+ name_or_field: Union[
64
+ str,
65
+ "Field",
66
+ Dict[str, Any],
67
+ ],
68
+ **params: Any,
69
+ ) -> "Field":
70
+ # {"type": "text", "analyzer": "snowball"}
71
+ if isinstance(name_or_field, collections.abc.Mapping):
72
+ if params:
73
+ raise ValueError(
74
+ "construct_field() cannot accept parameters when passing in a dict."
75
+ )
76
+ params = deepcopy(name_or_field)
77
+ if "type" not in params:
78
+ # inner object can be implicitly defined
79
+ if "properties" in params:
80
+ name = "object"
81
+ else:
82
+ raise ValueError('construct_field() needs to have a "type" key.')
83
+ else:
84
+ name = params.pop("type")
85
+ return Field.get_dsl_class(name)(**params)
86
+
87
+ # Text()
88
+ if isinstance(name_or_field, Field):
89
+ if params:
90
+ raise ValueError(
91
+ "construct_field() cannot accept parameters "
92
+ "when passing in a construct_field object."
93
+ )
94
+ return name_or_field
95
+
96
+ # "text", analyzer="snowball"
97
+ return Field.get_dsl_class(name_or_field)(**params)
98
+
99
+
100
+ class Field(DslBase):
101
+ _type_name = "field"
102
+ _type_shortcut = staticmethod(construct_field)
103
+ # all fields can be multifields
104
+ _param_defs = {"fields": {"type": "field", "hash": True}}
105
+ name = ""
106
+ _coerce = False
107
+
108
+ def __init__(
109
+ self, multi: bool = False, required: bool = False, *args: Any, **kwargs: Any
110
+ ):
111
+ """
112
+ :arg bool multi: specifies whether field can contain array of values
113
+ :arg bool required: specifies whether field is required
114
+ """
115
+ self._multi = multi
116
+ self._required = required
117
+ super().__init__(*args, **kwargs)
118
+
119
+ def __getitem__(self, subfield: str) -> "Field":
120
+ return cast(Field, self._params.get("fields", {})[subfield])
121
+
122
+ def _serialize(self, data: Any) -> Any:
123
+ return data
124
+
125
+ def _deserialize(self, data: Any) -> Any:
126
+ return data
127
+
128
+ def _empty(self) -> Optional[Any]:
129
+ return None
130
+
131
+ def empty(self) -> Optional[Any]:
132
+ if self._multi:
133
+ return AttrList([])
134
+ return self._empty()
135
+
136
+ def serialize(self, data: Any) -> Any:
137
+ if isinstance(data, (list, AttrList, tuple)):
138
+ return list(map(self._serialize, cast(Iterable[Any], data)))
139
+ return self._serialize(data)
140
+
141
+ def deserialize(self, data: Any) -> Any:
142
+ if isinstance(data, (list, AttrList, tuple)):
143
+ data = [
144
+ None if d is None else self._deserialize(d)
145
+ for d in cast(Iterable[Any], data)
146
+ ]
147
+ return data
148
+ if data is None:
149
+ return None
150
+ return self._deserialize(data)
151
+
152
+ def clean(self, data: Any) -> Any:
153
+ if data is not None:
154
+ data = self.deserialize(data)
155
+ if data in (None, [], {}) and self._required:
156
+ raise ValidationException("Value required for this field.")
157
+ return data
158
+
159
+ def to_dict(self) -> Dict[str, Any]:
160
+ d = super().to_dict()
161
+ name, value = cast(Tuple[str, Dict[str, Any]], d.popitem())
162
+ value["type"] = name
163
+ return value
164
+
165
+
166
+ class CustomField(Field):
167
+ name = "custom"
168
+ _coerce = True
169
+
170
+ def to_dict(self) -> Dict[str, Any]:
171
+ if isinstance(self.builtin_type, Field):
172
+ return self.builtin_type.to_dict()
173
+
174
+ d = super().to_dict()
175
+ d["type"] = self.builtin_type
176
+ return d
177
+
178
+
179
+ class RangeField(Field):
180
+ _coerce = True
181
+ _core_field: Optional[Field] = None
182
+
183
+ def _deserialize(self, data: Any) -> Range["_SupportsComparison"]:
184
+ if isinstance(data, Range):
185
+ return data
186
+ data = {k: self._core_field.deserialize(v) for k, v in data.items()} # type: ignore[union-attr]
187
+ return Range(data)
188
+
189
+ def _serialize(self, data: Any) -> Optional[Dict[str, Any]]:
190
+ if data is None:
191
+ return None
192
+ if not isinstance(data, collections.abc.Mapping):
193
+ data = data.to_dict()
194
+ return {k: self._core_field.serialize(v) for k, v in data.items()} # type: ignore[union-attr]
195
+
196
+
197
+ class Float(Field):
198
+ """
199
+ :arg null_value:
200
+ :arg boost:
201
+ :arg coerce:
202
+ :arg ignore_malformed:
203
+ :arg index:
204
+ :arg on_script_error:
205
+ :arg script:
206
+ :arg time_series_metric: For internal use by Elastic only. Marks the
207
+ field as a time series dimension. Defaults to false.
208
+ :arg time_series_dimension: For internal use by Elastic only. Marks
209
+ the field as a time series dimension. Defaults to false.
210
+ :arg doc_values:
211
+ :arg copy_to:
212
+ :arg store:
213
+ :arg meta: Metadata about the field.
214
+ :arg properties:
215
+ :arg ignore_above:
216
+ :arg dynamic:
217
+ :arg fields:
218
+ :arg synthetic_source_keep:
219
+ """
220
+
221
+ name = "float"
222
+ _coerce = True
223
+ _param_defs = {
224
+ "properties": {"type": "field", "hash": True},
225
+ "fields": {"type": "field", "hash": True},
226
+ }
227
+
228
+ def __init__(
229
+ self,
230
+ *args: Any,
231
+ null_value: Union[float, "DefaultType"] = DEFAULT,
232
+ boost: Union[float, "DefaultType"] = DEFAULT,
233
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
234
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
235
+ index: Union[bool, "DefaultType"] = DEFAULT,
236
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
237
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
238
+ time_series_metric: Union[
239
+ Literal["gauge", "counter", "summary", "histogram", "position"],
240
+ "DefaultType",
241
+ ] = DEFAULT,
242
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
243
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
244
+ copy_to: Union[
245
+ Union[str, "InstrumentedField"],
246
+ Sequence[Union[str, "InstrumentedField"]],
247
+ "DefaultType",
248
+ ] = DEFAULT,
249
+ store: Union[bool, "DefaultType"] = DEFAULT,
250
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
251
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
252
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
253
+ dynamic: Union[
254
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
255
+ ] = DEFAULT,
256
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
257
+ synthetic_source_keep: Union[
258
+ Literal["none", "arrays", "all"], "DefaultType"
259
+ ] = DEFAULT,
260
+ **kwargs: Any,
261
+ ):
262
+ if null_value is not DEFAULT:
263
+ kwargs["null_value"] = null_value
264
+ if boost is not DEFAULT:
265
+ kwargs["boost"] = boost
266
+ if coerce is not DEFAULT:
267
+ kwargs["coerce"] = coerce
268
+ if ignore_malformed is not DEFAULT:
269
+ kwargs["ignore_malformed"] = ignore_malformed
270
+ if index is not DEFAULT:
271
+ kwargs["index"] = index
272
+ if on_script_error is not DEFAULT:
273
+ kwargs["on_script_error"] = on_script_error
274
+ if script is not DEFAULT:
275
+ kwargs["script"] = script
276
+ if time_series_metric is not DEFAULT:
277
+ kwargs["time_series_metric"] = time_series_metric
278
+ if time_series_dimension is not DEFAULT:
279
+ kwargs["time_series_dimension"] = time_series_dimension
280
+ if doc_values is not DEFAULT:
281
+ kwargs["doc_values"] = doc_values
282
+ if copy_to is not DEFAULT:
283
+ kwargs["copy_to"] = str(copy_to)
284
+ if store is not DEFAULT:
285
+ kwargs["store"] = store
286
+ if meta is not DEFAULT:
287
+ kwargs["meta"] = meta
288
+ if properties is not DEFAULT:
289
+ kwargs["properties"] = properties
290
+ if ignore_above is not DEFAULT:
291
+ kwargs["ignore_above"] = ignore_above
292
+ if dynamic is not DEFAULT:
293
+ kwargs["dynamic"] = dynamic
294
+ if fields is not DEFAULT:
295
+ kwargs["fields"] = fields
296
+ if synthetic_source_keep is not DEFAULT:
297
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
298
+ super().__init__(*args, **kwargs)
299
+
300
+ def _deserialize(self, data: Any) -> float:
301
+ return float(data)
302
+
303
+
304
+ class Integer(Field):
305
+ """
306
+ :arg null_value:
307
+ :arg boost:
308
+ :arg coerce:
309
+ :arg ignore_malformed:
310
+ :arg index:
311
+ :arg on_script_error:
312
+ :arg script:
313
+ :arg time_series_metric: For internal use by Elastic only. Marks the
314
+ field as a time series dimension. Defaults to false.
315
+ :arg time_series_dimension: For internal use by Elastic only. Marks
316
+ the field as a time series dimension. Defaults to false.
317
+ :arg doc_values:
318
+ :arg copy_to:
319
+ :arg store:
320
+ :arg meta: Metadata about the field.
321
+ :arg properties:
322
+ :arg ignore_above:
323
+ :arg dynamic:
324
+ :arg fields:
325
+ :arg synthetic_source_keep:
326
+ """
327
+
328
+ name = "integer"
329
+ _coerce = True
330
+ _param_defs = {
331
+ "properties": {"type": "field", "hash": True},
332
+ "fields": {"type": "field", "hash": True},
333
+ }
334
+
335
+ def __init__(
336
+ self,
337
+ *args: Any,
338
+ null_value: Union[int, "DefaultType"] = DEFAULT,
339
+ boost: Union[float, "DefaultType"] = DEFAULT,
340
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
341
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
342
+ index: Union[bool, "DefaultType"] = DEFAULT,
343
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
344
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
345
+ time_series_metric: Union[
346
+ Literal["gauge", "counter", "summary", "histogram", "position"],
347
+ "DefaultType",
348
+ ] = DEFAULT,
349
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
350
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
351
+ copy_to: Union[
352
+ Union[str, "InstrumentedField"],
353
+ Sequence[Union[str, "InstrumentedField"]],
354
+ "DefaultType",
355
+ ] = DEFAULT,
356
+ store: Union[bool, "DefaultType"] = DEFAULT,
357
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
358
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
359
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
360
+ dynamic: Union[
361
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
362
+ ] = DEFAULT,
363
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
364
+ synthetic_source_keep: Union[
365
+ Literal["none", "arrays", "all"], "DefaultType"
366
+ ] = DEFAULT,
367
+ **kwargs: Any,
368
+ ):
369
+ if null_value is not DEFAULT:
370
+ kwargs["null_value"] = null_value
371
+ if boost is not DEFAULT:
372
+ kwargs["boost"] = boost
373
+ if coerce is not DEFAULT:
374
+ kwargs["coerce"] = coerce
375
+ if ignore_malformed is not DEFAULT:
376
+ kwargs["ignore_malformed"] = ignore_malformed
377
+ if index is not DEFAULT:
378
+ kwargs["index"] = index
379
+ if on_script_error is not DEFAULT:
380
+ kwargs["on_script_error"] = on_script_error
381
+ if script is not DEFAULT:
382
+ kwargs["script"] = script
383
+ if time_series_metric is not DEFAULT:
384
+ kwargs["time_series_metric"] = time_series_metric
385
+ if time_series_dimension is not DEFAULT:
386
+ kwargs["time_series_dimension"] = time_series_dimension
387
+ if doc_values is not DEFAULT:
388
+ kwargs["doc_values"] = doc_values
389
+ if copy_to is not DEFAULT:
390
+ kwargs["copy_to"] = str(copy_to)
391
+ if store is not DEFAULT:
392
+ kwargs["store"] = store
393
+ if meta is not DEFAULT:
394
+ kwargs["meta"] = meta
395
+ if properties is not DEFAULT:
396
+ kwargs["properties"] = properties
397
+ if ignore_above is not DEFAULT:
398
+ kwargs["ignore_above"] = ignore_above
399
+ if dynamic is not DEFAULT:
400
+ kwargs["dynamic"] = dynamic
401
+ if fields is not DEFAULT:
402
+ kwargs["fields"] = fields
403
+ if synthetic_source_keep is not DEFAULT:
404
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
405
+ super().__init__(*args, **kwargs)
406
+
407
+ def _deserialize(self, data: Any) -> int:
408
+ return int(data)
409
+
410
+
411
+ class Object(Field):
412
+ """
413
+ :arg doc_class: base doc class that handles mapping.
414
+ If no `doc_class` is provided, new instance of `InnerDoc` will be created,
415
+ populated with `properties` and used. Can not be provided together with `properties`
416
+ :arg enabled:
417
+ :arg subobjects:
418
+ :arg copy_to:
419
+ :arg store:
420
+ :arg meta: Metadata about the field.
421
+ :arg properties:
422
+ :arg ignore_above:
423
+ :arg dynamic:
424
+ :arg fields:
425
+ :arg synthetic_source_keep:
426
+ """
427
+
428
+ name = "object"
429
+ _coerce = True
430
+ _param_defs = {
431
+ "properties": {"type": "field", "hash": True},
432
+ "fields": {"type": "field", "hash": True},
433
+ }
434
+
435
+ def __init__(
436
+ self,
437
+ doc_class: Union[Type["InnerDoc"], "DefaultType"] = DEFAULT,
438
+ *args: Any,
439
+ enabled: Union[bool, "DefaultType"] = DEFAULT,
440
+ subobjects: Union[bool, "DefaultType"] = DEFAULT,
441
+ copy_to: Union[
442
+ Union[str, "InstrumentedField"],
443
+ Sequence[Union[str, "InstrumentedField"]],
444
+ "DefaultType",
445
+ ] = DEFAULT,
446
+ store: Union[bool, "DefaultType"] = DEFAULT,
447
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
448
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
449
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
450
+ dynamic: Union[
451
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
452
+ ] = DEFAULT,
453
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
454
+ synthetic_source_keep: Union[
455
+ Literal["none", "arrays", "all"], "DefaultType"
456
+ ] = DEFAULT,
457
+ **kwargs: Any,
458
+ ):
459
+ if enabled is not DEFAULT:
460
+ kwargs["enabled"] = enabled
461
+ if subobjects is not DEFAULT:
462
+ kwargs["subobjects"] = subobjects
463
+ if copy_to is not DEFAULT:
464
+ kwargs["copy_to"] = str(copy_to)
465
+ if store is not DEFAULT:
466
+ kwargs["store"] = store
467
+ if meta is not DEFAULT:
468
+ kwargs["meta"] = meta
469
+ if properties is not DEFAULT:
470
+ kwargs["properties"] = properties
471
+ if ignore_above is not DEFAULT:
472
+ kwargs["ignore_above"] = ignore_above
473
+ if dynamic is not DEFAULT:
474
+ kwargs["dynamic"] = dynamic
475
+ if fields is not DEFAULT:
476
+ kwargs["fields"] = fields
477
+ if synthetic_source_keep is not DEFAULT:
478
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
479
+
480
+ if doc_class is not DEFAULT and (
481
+ properties is not DEFAULT or dynamic is not DEFAULT
482
+ ):
483
+ raise ValidationException(
484
+ "doc_class and properties/dynamic should not be provided together"
485
+ )
486
+ if doc_class is not DEFAULT:
487
+ self._doc_class: Type["InnerDoc"] = doc_class
488
+ else:
489
+ # FIXME import
490
+ from .document import InnerDoc
491
+
492
+ # no InnerDoc subclass, creating one instead...
493
+ self._doc_class = type("InnerDoc", (InnerDoc,), {})
494
+ for name, field in (
495
+ properties if properties is not DEFAULT else {}
496
+ ).items():
497
+ self._doc_class._doc_type.mapping.field(name, field)
498
+ if "properties" in kwargs:
499
+ del kwargs["properties"]
500
+ if dynamic is not DEFAULT:
501
+ self._doc_class._doc_type.mapping.meta("dynamic", dynamic)
502
+
503
+ self._mapping: "MappingBase" = deepcopy(self._doc_class._doc_type.mapping)
504
+ super().__init__(**kwargs)
505
+
506
+ def __getitem__(self, name: str) -> Field:
507
+ return self._mapping[name]
508
+
509
+ def __contains__(self, name: str) -> bool:
510
+ return name in self._mapping
511
+
512
+ def _empty(self) -> "InnerDoc":
513
+ return self._wrap({})
514
+
515
+ def _wrap(self, data: Dict[str, Any]) -> "InnerDoc":
516
+ return self._doc_class.from_es(data, data_only=True)
517
+
518
+ def empty(self) -> Union["InnerDoc", AttrList[Any]]:
519
+ if self._multi:
520
+ return AttrList[Any]([], self._wrap)
521
+ return self._empty()
522
+
523
+ def to_dict(self) -> Dict[str, Any]:
524
+ d = self._mapping.to_dict()
525
+ d.update(super().to_dict())
526
+ return d
527
+
528
+ def _collect_fields(self) -> Iterator[Field]:
529
+ return self._mapping.properties._collect_fields()
530
+
531
+ def _deserialize(self, data: Any) -> "InnerDoc":
532
+ # don't wrap already wrapped data
533
+ if isinstance(data, self._doc_class):
534
+ return data
535
+
536
+ if isinstance(data, AttrDict):
537
+ data = data._d_
538
+
539
+ return self._wrap(data)
540
+
541
+ def _serialize(
542
+ self, data: Optional[Union[Dict[str, Any], "InnerDoc"]]
543
+ ) -> Optional[Dict[str, Any]]:
544
+ if data is None:
545
+ return None
546
+
547
+ # somebody assigned raw dict to the field, we should tolerate that
548
+ if isinstance(data, collections.abc.Mapping):
549
+ return data
550
+
551
+ return data.to_dict()
552
+
553
+ def clean(self, data: Any) -> Any:
554
+ data = super().clean(data)
555
+ if data is None:
556
+ return None
557
+ if isinstance(data, (list, AttrList)):
558
+ for d in cast(Iterator["InnerDoc"], data):
559
+ d.full_clean()
560
+ else:
561
+ data.full_clean()
562
+ return data
563
+
564
+ def update(self, other: Any, update_only: bool = False) -> None:
565
+ if not isinstance(other, Object):
566
+ # not an inner/nested object, no merge possible
567
+ return
568
+
569
+ self._mapping.update(other._mapping, update_only)
570
+
571
+
572
+ class AggregateMetricDouble(Field):
573
+ """
574
+ :arg default_metric: (required)
575
+ :arg metrics: (required)
576
+ :arg time_series_metric:
577
+ :arg meta: Metadata about the field.
578
+ :arg properties:
579
+ :arg ignore_above:
580
+ :arg dynamic:
581
+ :arg fields:
582
+ :arg synthetic_source_keep:
583
+ """
584
+
585
+ name = "aggregate_metric_double"
586
+ _param_defs = {
587
+ "properties": {"type": "field", "hash": True},
588
+ "fields": {"type": "field", "hash": True},
589
+ }
590
+
591
+ def __init__(
592
+ self,
593
+ *args: Any,
594
+ default_metric: Union[str, "DefaultType"] = DEFAULT,
595
+ metrics: Union[Sequence[str], "DefaultType"] = DEFAULT,
596
+ time_series_metric: Union[
597
+ Literal["gauge", "counter", "summary", "histogram", "position"],
598
+ "DefaultType",
599
+ ] = DEFAULT,
600
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
601
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
602
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
603
+ dynamic: Union[
604
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
605
+ ] = DEFAULT,
606
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
607
+ synthetic_source_keep: Union[
608
+ Literal["none", "arrays", "all"], "DefaultType"
609
+ ] = DEFAULT,
610
+ **kwargs: Any,
611
+ ):
612
+ if default_metric is not DEFAULT:
613
+ kwargs["default_metric"] = default_metric
614
+ if metrics is not DEFAULT:
615
+ kwargs["metrics"] = metrics
616
+ if time_series_metric is not DEFAULT:
617
+ kwargs["time_series_metric"] = time_series_metric
618
+ if meta is not DEFAULT:
619
+ kwargs["meta"] = meta
620
+ if properties is not DEFAULT:
621
+ kwargs["properties"] = properties
622
+ if ignore_above is not DEFAULT:
623
+ kwargs["ignore_above"] = ignore_above
624
+ if dynamic is not DEFAULT:
625
+ kwargs["dynamic"] = dynamic
626
+ if fields is not DEFAULT:
627
+ kwargs["fields"] = fields
628
+ if synthetic_source_keep is not DEFAULT:
629
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
630
+ super().__init__(*args, **kwargs)
631
+
632
+
633
+ class Alias(Field):
634
+ """
635
+ :arg path:
636
+ :arg meta: Metadata about the field.
637
+ :arg properties:
638
+ :arg ignore_above:
639
+ :arg dynamic:
640
+ :arg fields:
641
+ :arg synthetic_source_keep:
642
+ """
643
+
644
+ name = "alias"
645
+ _param_defs = {
646
+ "properties": {"type": "field", "hash": True},
647
+ "fields": {"type": "field", "hash": True},
648
+ }
649
+
650
+ def __init__(
651
+ self,
652
+ *args: Any,
653
+ path: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
654
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
655
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
656
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
657
+ dynamic: Union[
658
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
659
+ ] = DEFAULT,
660
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
661
+ synthetic_source_keep: Union[
662
+ Literal["none", "arrays", "all"], "DefaultType"
663
+ ] = DEFAULT,
664
+ **kwargs: Any,
665
+ ):
666
+ if path is not DEFAULT:
667
+ kwargs["path"] = str(path)
668
+ if meta is not DEFAULT:
669
+ kwargs["meta"] = meta
670
+ if properties is not DEFAULT:
671
+ kwargs["properties"] = properties
672
+ if ignore_above is not DEFAULT:
673
+ kwargs["ignore_above"] = ignore_above
674
+ if dynamic is not DEFAULT:
675
+ kwargs["dynamic"] = dynamic
676
+ if fields is not DEFAULT:
677
+ kwargs["fields"] = fields
678
+ if synthetic_source_keep is not DEFAULT:
679
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
680
+ super().__init__(*args, **kwargs)
681
+
682
+
683
+ class Binary(Field):
684
+ """
685
+ :arg doc_values:
686
+ :arg copy_to:
687
+ :arg store:
688
+ :arg meta: Metadata about the field.
689
+ :arg properties:
690
+ :arg ignore_above:
691
+ :arg dynamic:
692
+ :arg fields:
693
+ :arg synthetic_source_keep:
694
+ """
695
+
696
+ name = "binary"
697
+ _coerce = True
698
+ _param_defs = {
699
+ "properties": {"type": "field", "hash": True},
700
+ "fields": {"type": "field", "hash": True},
701
+ }
702
+
703
+ def __init__(
704
+ self,
705
+ *args: Any,
706
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
707
+ copy_to: Union[
708
+ Union[str, "InstrumentedField"],
709
+ Sequence[Union[str, "InstrumentedField"]],
710
+ "DefaultType",
711
+ ] = DEFAULT,
712
+ store: Union[bool, "DefaultType"] = DEFAULT,
713
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
714
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
715
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
716
+ dynamic: Union[
717
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
718
+ ] = DEFAULT,
719
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
720
+ synthetic_source_keep: Union[
721
+ Literal["none", "arrays", "all"], "DefaultType"
722
+ ] = DEFAULT,
723
+ **kwargs: Any,
724
+ ):
725
+ if doc_values is not DEFAULT:
726
+ kwargs["doc_values"] = doc_values
727
+ if copy_to is not DEFAULT:
728
+ kwargs["copy_to"] = str(copy_to)
729
+ if store is not DEFAULT:
730
+ kwargs["store"] = store
731
+ if meta is not DEFAULT:
732
+ kwargs["meta"] = meta
733
+ if properties is not DEFAULT:
734
+ kwargs["properties"] = properties
735
+ if ignore_above is not DEFAULT:
736
+ kwargs["ignore_above"] = ignore_above
737
+ if dynamic is not DEFAULT:
738
+ kwargs["dynamic"] = dynamic
739
+ if fields is not DEFAULT:
740
+ kwargs["fields"] = fields
741
+ if synthetic_source_keep is not DEFAULT:
742
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
743
+ super().__init__(*args, **kwargs)
744
+
745
+ def clean(self, data: str) -> str:
746
+ # Binary fields are opaque, so there's not much cleaning
747
+ # that can be done.
748
+ return data
749
+
750
+ def _deserialize(self, data: Any) -> bytes:
751
+ return base64.b64decode(data)
752
+
753
+ def _serialize(self, data: Any) -> Optional[str]:
754
+ if data is None:
755
+ return None
756
+ return base64.b64encode(data).decode()
757
+
758
+
759
+ class Boolean(Field):
760
+ """
761
+ :arg boost:
762
+ :arg fielddata:
763
+ :arg index:
764
+ :arg null_value:
765
+ :arg ignore_malformed:
766
+ :arg script:
767
+ :arg on_script_error:
768
+ :arg time_series_dimension: For internal use by Elastic only. Marks
769
+ the field as a time series dimension. Defaults to false.
770
+ :arg doc_values:
771
+ :arg copy_to:
772
+ :arg store:
773
+ :arg meta: Metadata about the field.
774
+ :arg properties:
775
+ :arg ignore_above:
776
+ :arg dynamic:
777
+ :arg fields:
778
+ :arg synthetic_source_keep:
779
+ """
780
+
781
+ name = "boolean"
782
+ _coerce = True
783
+ _param_defs = {
784
+ "properties": {"type": "field", "hash": True},
785
+ "fields": {"type": "field", "hash": True},
786
+ }
787
+
788
+ def __init__(
789
+ self,
790
+ *args: Any,
791
+ boost: Union[float, "DefaultType"] = DEFAULT,
792
+ fielddata: Union[
793
+ "types.NumericFielddata", Dict[str, Any], "DefaultType"
794
+ ] = DEFAULT,
795
+ index: Union[bool, "DefaultType"] = DEFAULT,
796
+ null_value: Union[bool, "DefaultType"] = DEFAULT,
797
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
798
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
799
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
800
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
801
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
802
+ copy_to: Union[
803
+ Union[str, "InstrumentedField"],
804
+ Sequence[Union[str, "InstrumentedField"]],
805
+ "DefaultType",
806
+ ] = DEFAULT,
807
+ store: Union[bool, "DefaultType"] = DEFAULT,
808
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
809
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
810
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
811
+ dynamic: Union[
812
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
813
+ ] = DEFAULT,
814
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
815
+ synthetic_source_keep: Union[
816
+ Literal["none", "arrays", "all"], "DefaultType"
817
+ ] = DEFAULT,
818
+ **kwargs: Any,
819
+ ):
820
+ if boost is not DEFAULT:
821
+ kwargs["boost"] = boost
822
+ if fielddata is not DEFAULT:
823
+ kwargs["fielddata"] = fielddata
824
+ if index is not DEFAULT:
825
+ kwargs["index"] = index
826
+ if null_value is not DEFAULT:
827
+ kwargs["null_value"] = null_value
828
+ if ignore_malformed is not DEFAULT:
829
+ kwargs["ignore_malformed"] = ignore_malformed
830
+ if script is not DEFAULT:
831
+ kwargs["script"] = script
832
+ if on_script_error is not DEFAULT:
833
+ kwargs["on_script_error"] = on_script_error
834
+ if time_series_dimension is not DEFAULT:
835
+ kwargs["time_series_dimension"] = time_series_dimension
836
+ if doc_values is not DEFAULT:
837
+ kwargs["doc_values"] = doc_values
838
+ if copy_to is not DEFAULT:
839
+ kwargs["copy_to"] = str(copy_to)
840
+ if store is not DEFAULT:
841
+ kwargs["store"] = store
842
+ if meta is not DEFAULT:
843
+ kwargs["meta"] = meta
844
+ if properties is not DEFAULT:
845
+ kwargs["properties"] = properties
846
+ if ignore_above is not DEFAULT:
847
+ kwargs["ignore_above"] = ignore_above
848
+ if dynamic is not DEFAULT:
849
+ kwargs["dynamic"] = dynamic
850
+ if fields is not DEFAULT:
851
+ kwargs["fields"] = fields
852
+ if synthetic_source_keep is not DEFAULT:
853
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
854
+ super().__init__(*args, **kwargs)
855
+
856
+ def _deserialize(self, data: Any) -> bool:
857
+ if data == "false":
858
+ return False
859
+ return bool(data)
860
+
861
+ def clean(self, data: Any) -> Optional[bool]:
862
+ if data is not None:
863
+ data = self.deserialize(data)
864
+ if data is None and self._required:
865
+ raise ValidationException("Value required for this field.")
866
+ return data # type: ignore[no-any-return]
867
+
868
+
869
+ class Byte(Integer):
870
+ """
871
+ :arg null_value:
872
+ :arg boost:
873
+ :arg coerce:
874
+ :arg ignore_malformed:
875
+ :arg index:
876
+ :arg on_script_error:
877
+ :arg script:
878
+ :arg time_series_metric: For internal use by Elastic only. Marks the
879
+ field as a time series dimension. Defaults to false.
880
+ :arg time_series_dimension: For internal use by Elastic only. Marks
881
+ the field as a time series dimension. Defaults to false.
882
+ :arg doc_values:
883
+ :arg copy_to:
884
+ :arg store:
885
+ :arg meta: Metadata about the field.
886
+ :arg properties:
887
+ :arg ignore_above:
888
+ :arg dynamic:
889
+ :arg fields:
890
+ :arg synthetic_source_keep:
891
+ """
892
+
893
+ name = "byte"
894
+ _param_defs = {
895
+ "properties": {"type": "field", "hash": True},
896
+ "fields": {"type": "field", "hash": True},
897
+ }
898
+
899
+ def __init__(
900
+ self,
901
+ *args: Any,
902
+ null_value: Union[float, "DefaultType"] = DEFAULT,
903
+ boost: Union[float, "DefaultType"] = DEFAULT,
904
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
905
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
906
+ index: Union[bool, "DefaultType"] = DEFAULT,
907
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
908
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
909
+ time_series_metric: Union[
910
+ Literal["gauge", "counter", "summary", "histogram", "position"],
911
+ "DefaultType",
912
+ ] = DEFAULT,
913
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
914
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
915
+ copy_to: Union[
916
+ Union[str, "InstrumentedField"],
917
+ Sequence[Union[str, "InstrumentedField"]],
918
+ "DefaultType",
919
+ ] = DEFAULT,
920
+ store: Union[bool, "DefaultType"] = DEFAULT,
921
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
922
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
923
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
924
+ dynamic: Union[
925
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
926
+ ] = DEFAULT,
927
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
928
+ synthetic_source_keep: Union[
929
+ Literal["none", "arrays", "all"], "DefaultType"
930
+ ] = DEFAULT,
931
+ **kwargs: Any,
932
+ ):
933
+ if null_value is not DEFAULT:
934
+ kwargs["null_value"] = null_value
935
+ if boost is not DEFAULT:
936
+ kwargs["boost"] = boost
937
+ if coerce is not DEFAULT:
938
+ kwargs["coerce"] = coerce
939
+ if ignore_malformed is not DEFAULT:
940
+ kwargs["ignore_malformed"] = ignore_malformed
941
+ if index is not DEFAULT:
942
+ kwargs["index"] = index
943
+ if on_script_error is not DEFAULT:
944
+ kwargs["on_script_error"] = on_script_error
945
+ if script is not DEFAULT:
946
+ kwargs["script"] = script
947
+ if time_series_metric is not DEFAULT:
948
+ kwargs["time_series_metric"] = time_series_metric
949
+ if time_series_dimension is not DEFAULT:
950
+ kwargs["time_series_dimension"] = time_series_dimension
951
+ if doc_values is not DEFAULT:
952
+ kwargs["doc_values"] = doc_values
953
+ if copy_to is not DEFAULT:
954
+ kwargs["copy_to"] = str(copy_to)
955
+ if store is not DEFAULT:
956
+ kwargs["store"] = store
957
+ if meta is not DEFAULT:
958
+ kwargs["meta"] = meta
959
+ if properties is not DEFAULT:
960
+ kwargs["properties"] = properties
961
+ if ignore_above is not DEFAULT:
962
+ kwargs["ignore_above"] = ignore_above
963
+ if dynamic is not DEFAULT:
964
+ kwargs["dynamic"] = dynamic
965
+ if fields is not DEFAULT:
966
+ kwargs["fields"] = fields
967
+ if synthetic_source_keep is not DEFAULT:
968
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
969
+ super().__init__(*args, **kwargs)
970
+
971
+
972
+ class Completion(Field):
973
+ """
974
+ :arg analyzer:
975
+ :arg contexts:
976
+ :arg max_input_length:
977
+ :arg preserve_position_increments:
978
+ :arg preserve_separators:
979
+ :arg search_analyzer:
980
+ :arg doc_values:
981
+ :arg copy_to:
982
+ :arg store:
983
+ :arg meta: Metadata about the field.
984
+ :arg properties:
985
+ :arg ignore_above:
986
+ :arg dynamic:
987
+ :arg fields:
988
+ :arg synthetic_source_keep:
989
+ """
990
+
991
+ name = "completion"
992
+ _param_defs = {
993
+ "analyzer": {"type": "analyzer"},
994
+ "search_analyzer": {"type": "analyzer"},
995
+ "properties": {"type": "field", "hash": True},
996
+ "fields": {"type": "field", "hash": True},
997
+ }
998
+
999
+ def __init__(
1000
+ self,
1001
+ *args: Any,
1002
+ analyzer: Union[str, DslBase, "DefaultType"] = DEFAULT,
1003
+ contexts: Union[
1004
+ Sequence["types.SuggestContext"], Sequence[Dict[str, Any]], "DefaultType"
1005
+ ] = DEFAULT,
1006
+ max_input_length: Union[int, "DefaultType"] = DEFAULT,
1007
+ preserve_position_increments: Union[bool, "DefaultType"] = DEFAULT,
1008
+ preserve_separators: Union[bool, "DefaultType"] = DEFAULT,
1009
+ search_analyzer: Union[str, DslBase, "DefaultType"] = DEFAULT,
1010
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1011
+ copy_to: Union[
1012
+ Union[str, "InstrumentedField"],
1013
+ Sequence[Union[str, "InstrumentedField"]],
1014
+ "DefaultType",
1015
+ ] = DEFAULT,
1016
+ store: Union[bool, "DefaultType"] = DEFAULT,
1017
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1018
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1019
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1020
+ dynamic: Union[
1021
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1022
+ ] = DEFAULT,
1023
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1024
+ synthetic_source_keep: Union[
1025
+ Literal["none", "arrays", "all"], "DefaultType"
1026
+ ] = DEFAULT,
1027
+ **kwargs: Any,
1028
+ ):
1029
+ if analyzer is not DEFAULT:
1030
+ kwargs["analyzer"] = analyzer
1031
+ if contexts is not DEFAULT:
1032
+ kwargs["contexts"] = contexts
1033
+ if max_input_length is not DEFAULT:
1034
+ kwargs["max_input_length"] = max_input_length
1035
+ if preserve_position_increments is not DEFAULT:
1036
+ kwargs["preserve_position_increments"] = preserve_position_increments
1037
+ if preserve_separators is not DEFAULT:
1038
+ kwargs["preserve_separators"] = preserve_separators
1039
+ if search_analyzer is not DEFAULT:
1040
+ kwargs["search_analyzer"] = search_analyzer
1041
+ if doc_values is not DEFAULT:
1042
+ kwargs["doc_values"] = doc_values
1043
+ if copy_to is not DEFAULT:
1044
+ kwargs["copy_to"] = str(copy_to)
1045
+ if store is not DEFAULT:
1046
+ kwargs["store"] = store
1047
+ if meta is not DEFAULT:
1048
+ kwargs["meta"] = meta
1049
+ if properties is not DEFAULT:
1050
+ kwargs["properties"] = properties
1051
+ if ignore_above is not DEFAULT:
1052
+ kwargs["ignore_above"] = ignore_above
1053
+ if dynamic is not DEFAULT:
1054
+ kwargs["dynamic"] = dynamic
1055
+ if fields is not DEFAULT:
1056
+ kwargs["fields"] = fields
1057
+ if synthetic_source_keep is not DEFAULT:
1058
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1059
+ super().__init__(*args, **kwargs)
1060
+
1061
+
1062
+ class ConstantKeyword(Field):
1063
+ """
1064
+ :arg value:
1065
+ :arg meta: Metadata about the field.
1066
+ :arg properties:
1067
+ :arg ignore_above:
1068
+ :arg dynamic:
1069
+ :arg fields:
1070
+ :arg synthetic_source_keep:
1071
+ """
1072
+
1073
+ name = "constant_keyword"
1074
+ _param_defs = {
1075
+ "properties": {"type": "field", "hash": True},
1076
+ "fields": {"type": "field", "hash": True},
1077
+ }
1078
+
1079
+ def __init__(
1080
+ self,
1081
+ *args: Any,
1082
+ value: Any = DEFAULT,
1083
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1084
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1085
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1086
+ dynamic: Union[
1087
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1088
+ ] = DEFAULT,
1089
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1090
+ synthetic_source_keep: Union[
1091
+ Literal["none", "arrays", "all"], "DefaultType"
1092
+ ] = DEFAULT,
1093
+ **kwargs: Any,
1094
+ ):
1095
+ if value is not DEFAULT:
1096
+ kwargs["value"] = value
1097
+ if meta is not DEFAULT:
1098
+ kwargs["meta"] = meta
1099
+ if properties is not DEFAULT:
1100
+ kwargs["properties"] = properties
1101
+ if ignore_above is not DEFAULT:
1102
+ kwargs["ignore_above"] = ignore_above
1103
+ if dynamic is not DEFAULT:
1104
+ kwargs["dynamic"] = dynamic
1105
+ if fields is not DEFAULT:
1106
+ kwargs["fields"] = fields
1107
+ if synthetic_source_keep is not DEFAULT:
1108
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1109
+ super().__init__(*args, **kwargs)
1110
+
1111
+
1112
+ class Date(Field):
1113
+ """
1114
+ :arg default_timezone: timezone that will be automatically used for tz-naive values
1115
+ May be instance of `datetime.tzinfo` or string containing TZ offset
1116
+ :arg boost:
1117
+ :arg fielddata:
1118
+ :arg format:
1119
+ :arg ignore_malformed:
1120
+ :arg index:
1121
+ :arg null_value:
1122
+ :arg precision_step:
1123
+ :arg locale:
1124
+ :arg doc_values:
1125
+ :arg copy_to:
1126
+ :arg store:
1127
+ :arg meta: Metadata about the field.
1128
+ :arg properties:
1129
+ :arg ignore_above:
1130
+ :arg dynamic:
1131
+ :arg fields:
1132
+ :arg synthetic_source_keep:
1133
+ """
1134
+
1135
+ name = "date"
1136
+ _coerce = True
1137
+ _param_defs = {
1138
+ "properties": {"type": "field", "hash": True},
1139
+ "fields": {"type": "field", "hash": True},
1140
+ }
1141
+
1142
+ def __init__(
1143
+ self,
1144
+ default_timezone: Union[str, "tzinfo", "DefaultType"] = DEFAULT,
1145
+ *args: Any,
1146
+ boost: Union[float, "DefaultType"] = DEFAULT,
1147
+ fielddata: Union[
1148
+ "types.NumericFielddata", Dict[str, Any], "DefaultType"
1149
+ ] = DEFAULT,
1150
+ format: Union[str, "DefaultType"] = DEFAULT,
1151
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
1152
+ index: Union[bool, "DefaultType"] = DEFAULT,
1153
+ null_value: Any = DEFAULT,
1154
+ precision_step: Union[int, "DefaultType"] = DEFAULT,
1155
+ locale: Union[str, "DefaultType"] = DEFAULT,
1156
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1157
+ copy_to: Union[
1158
+ Union[str, "InstrumentedField"],
1159
+ Sequence[Union[str, "InstrumentedField"]],
1160
+ "DefaultType",
1161
+ ] = DEFAULT,
1162
+ store: Union[bool, "DefaultType"] = DEFAULT,
1163
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1164
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1165
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1166
+ dynamic: Union[
1167
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1168
+ ] = DEFAULT,
1169
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1170
+ synthetic_source_keep: Union[
1171
+ Literal["none", "arrays", "all"], "DefaultType"
1172
+ ] = DEFAULT,
1173
+ **kwargs: Any,
1174
+ ):
1175
+ if boost is not DEFAULT:
1176
+ kwargs["boost"] = boost
1177
+ if fielddata is not DEFAULT:
1178
+ kwargs["fielddata"] = fielddata
1179
+ if format is not DEFAULT:
1180
+ kwargs["format"] = format
1181
+ if ignore_malformed is not DEFAULT:
1182
+ kwargs["ignore_malformed"] = ignore_malformed
1183
+ if index is not DEFAULT:
1184
+ kwargs["index"] = index
1185
+ if null_value is not DEFAULT:
1186
+ kwargs["null_value"] = null_value
1187
+ if precision_step is not DEFAULT:
1188
+ kwargs["precision_step"] = precision_step
1189
+ if locale is not DEFAULT:
1190
+ kwargs["locale"] = locale
1191
+ if doc_values is not DEFAULT:
1192
+ kwargs["doc_values"] = doc_values
1193
+ if copy_to is not DEFAULT:
1194
+ kwargs["copy_to"] = str(copy_to)
1195
+ if store is not DEFAULT:
1196
+ kwargs["store"] = store
1197
+ if meta is not DEFAULT:
1198
+ kwargs["meta"] = meta
1199
+ if properties is not DEFAULT:
1200
+ kwargs["properties"] = properties
1201
+ if ignore_above is not DEFAULT:
1202
+ kwargs["ignore_above"] = ignore_above
1203
+ if dynamic is not DEFAULT:
1204
+ kwargs["dynamic"] = dynamic
1205
+ if fields is not DEFAULT:
1206
+ kwargs["fields"] = fields
1207
+ if synthetic_source_keep is not DEFAULT:
1208
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1209
+
1210
+ if default_timezone is DEFAULT:
1211
+ self._default_timezone = None
1212
+ elif isinstance(default_timezone, str):
1213
+ self._default_timezone = tz.gettz(default_timezone)
1214
+ else:
1215
+ self._default_timezone = default_timezone
1216
+ super().__init__(*args, **kwargs)
1217
+
1218
+ def _deserialize(self, data: Any) -> Union[datetime, date]:
1219
+ if isinstance(data, str):
1220
+ try:
1221
+ data = parser.parse(data)
1222
+ except Exception as e:
1223
+ raise ValidationException(
1224
+ f"Could not parse date from the value ({data!r})", e
1225
+ )
1226
+ # we treat the yyyy-MM-dd format as a special case
1227
+ if hasattr(self, "format") and self.format == "yyyy-MM-dd":
1228
+ data = data.date()
1229
+
1230
+ if isinstance(data, datetime):
1231
+ if self._default_timezone and data.tzinfo is None:
1232
+ data = data.replace(tzinfo=self._default_timezone)
1233
+ return data
1234
+ if isinstance(data, date):
1235
+ return data
1236
+ if isinstance(data, int):
1237
+ # Divide by a float to preserve milliseconds on the datetime.
1238
+ return datetime.utcfromtimestamp(data / 1000.0)
1239
+
1240
+ raise ValidationException(f"Could not parse date from the value ({data!r})")
1241
+
1242
+
1243
+ class DateNanos(Field):
1244
+ """
1245
+ :arg boost:
1246
+ :arg format:
1247
+ :arg ignore_malformed:
1248
+ :arg index:
1249
+ :arg null_value:
1250
+ :arg precision_step:
1251
+ :arg doc_values:
1252
+ :arg copy_to:
1253
+ :arg store:
1254
+ :arg meta: Metadata about the field.
1255
+ :arg properties:
1256
+ :arg ignore_above:
1257
+ :arg dynamic:
1258
+ :arg fields:
1259
+ :arg synthetic_source_keep:
1260
+ """
1261
+
1262
+ name = "date_nanos"
1263
+ _param_defs = {
1264
+ "properties": {"type": "field", "hash": True},
1265
+ "fields": {"type": "field", "hash": True},
1266
+ }
1267
+
1268
+ def __init__(
1269
+ self,
1270
+ *args: Any,
1271
+ boost: Union[float, "DefaultType"] = DEFAULT,
1272
+ format: Union[str, "DefaultType"] = DEFAULT,
1273
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
1274
+ index: Union[bool, "DefaultType"] = DEFAULT,
1275
+ null_value: Any = DEFAULT,
1276
+ precision_step: Union[int, "DefaultType"] = DEFAULT,
1277
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1278
+ copy_to: Union[
1279
+ Union[str, "InstrumentedField"],
1280
+ Sequence[Union[str, "InstrumentedField"]],
1281
+ "DefaultType",
1282
+ ] = DEFAULT,
1283
+ store: Union[bool, "DefaultType"] = DEFAULT,
1284
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1285
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1286
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1287
+ dynamic: Union[
1288
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1289
+ ] = DEFAULT,
1290
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1291
+ synthetic_source_keep: Union[
1292
+ Literal["none", "arrays", "all"], "DefaultType"
1293
+ ] = DEFAULT,
1294
+ **kwargs: Any,
1295
+ ):
1296
+ if boost is not DEFAULT:
1297
+ kwargs["boost"] = boost
1298
+ if format is not DEFAULT:
1299
+ kwargs["format"] = format
1300
+ if ignore_malformed is not DEFAULT:
1301
+ kwargs["ignore_malformed"] = ignore_malformed
1302
+ if index is not DEFAULT:
1303
+ kwargs["index"] = index
1304
+ if null_value is not DEFAULT:
1305
+ kwargs["null_value"] = null_value
1306
+ if precision_step is not DEFAULT:
1307
+ kwargs["precision_step"] = precision_step
1308
+ if doc_values is not DEFAULT:
1309
+ kwargs["doc_values"] = doc_values
1310
+ if copy_to is not DEFAULT:
1311
+ kwargs["copy_to"] = str(copy_to)
1312
+ if store is not DEFAULT:
1313
+ kwargs["store"] = store
1314
+ if meta is not DEFAULT:
1315
+ kwargs["meta"] = meta
1316
+ if properties is not DEFAULT:
1317
+ kwargs["properties"] = properties
1318
+ if ignore_above is not DEFAULT:
1319
+ kwargs["ignore_above"] = ignore_above
1320
+ if dynamic is not DEFAULT:
1321
+ kwargs["dynamic"] = dynamic
1322
+ if fields is not DEFAULT:
1323
+ kwargs["fields"] = fields
1324
+ if synthetic_source_keep is not DEFAULT:
1325
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1326
+ super().__init__(*args, **kwargs)
1327
+
1328
+
1329
+ class DateRange(RangeField):
1330
+ """
1331
+ :arg format:
1332
+ :arg boost:
1333
+ :arg coerce:
1334
+ :arg index:
1335
+ :arg doc_values:
1336
+ :arg copy_to:
1337
+ :arg store:
1338
+ :arg meta: Metadata about the field.
1339
+ :arg properties:
1340
+ :arg ignore_above:
1341
+ :arg dynamic:
1342
+ :arg fields:
1343
+ :arg synthetic_source_keep:
1344
+ """
1345
+
1346
+ name = "date_range"
1347
+ _core_field = Date()
1348
+ _param_defs = {
1349
+ "properties": {"type": "field", "hash": True},
1350
+ "fields": {"type": "field", "hash": True},
1351
+ }
1352
+
1353
+ def __init__(
1354
+ self,
1355
+ *args: Any,
1356
+ format: Union[str, "DefaultType"] = DEFAULT,
1357
+ boost: Union[float, "DefaultType"] = DEFAULT,
1358
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
1359
+ index: Union[bool, "DefaultType"] = DEFAULT,
1360
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1361
+ copy_to: Union[
1362
+ Union[str, "InstrumentedField"],
1363
+ Sequence[Union[str, "InstrumentedField"]],
1364
+ "DefaultType",
1365
+ ] = DEFAULT,
1366
+ store: Union[bool, "DefaultType"] = DEFAULT,
1367
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1368
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1369
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1370
+ dynamic: Union[
1371
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1372
+ ] = DEFAULT,
1373
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1374
+ synthetic_source_keep: Union[
1375
+ Literal["none", "arrays", "all"], "DefaultType"
1376
+ ] = DEFAULT,
1377
+ **kwargs: Any,
1378
+ ):
1379
+ if format is not DEFAULT:
1380
+ kwargs["format"] = format
1381
+ if boost is not DEFAULT:
1382
+ kwargs["boost"] = boost
1383
+ if coerce is not DEFAULT:
1384
+ kwargs["coerce"] = coerce
1385
+ if index is not DEFAULT:
1386
+ kwargs["index"] = index
1387
+ if doc_values is not DEFAULT:
1388
+ kwargs["doc_values"] = doc_values
1389
+ if copy_to is not DEFAULT:
1390
+ kwargs["copy_to"] = str(copy_to)
1391
+ if store is not DEFAULT:
1392
+ kwargs["store"] = store
1393
+ if meta is not DEFAULT:
1394
+ kwargs["meta"] = meta
1395
+ if properties is not DEFAULT:
1396
+ kwargs["properties"] = properties
1397
+ if ignore_above is not DEFAULT:
1398
+ kwargs["ignore_above"] = ignore_above
1399
+ if dynamic is not DEFAULT:
1400
+ kwargs["dynamic"] = dynamic
1401
+ if fields is not DEFAULT:
1402
+ kwargs["fields"] = fields
1403
+ if synthetic_source_keep is not DEFAULT:
1404
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1405
+ super().__init__(*args, **kwargs)
1406
+
1407
+
1408
+ class DenseVector(Field):
1409
+ """
1410
+ :arg dims: Number of vector dimensions. Can't exceed `4096`. If `dims`
1411
+ is not specified, it will be set to the length of the first vector
1412
+ added to the field.
1413
+ :arg element_type: The data type used to encode vectors. The supported
1414
+ data types are `float` (default), `byte`, and `bit`. Defaults to
1415
+ `float` if omitted.
1416
+ :arg index: If `true`, you can search this field using the kNN search
1417
+ API. Defaults to `True` if omitted.
1418
+ :arg index_options: An optional section that configures the kNN
1419
+ indexing algorithm. The HNSW algorithm has two internal parameters
1420
+ that influence how the data structure is built. These can be
1421
+ adjusted to improve the accuracy of results, at the expense of
1422
+ slower indexing speed. This parameter can only be specified when
1423
+ `index` is `true`.
1424
+ :arg similarity: The vector similarity metric to use in kNN search.
1425
+ Documents are ranked by their vector field's similarity to the
1426
+ query vector. The `_score` of each document will be derived from
1427
+ the similarity, in a way that ensures scores are positive and that
1428
+ a larger score corresponds to a higher ranking. Defaults to
1429
+ `l2_norm` when `element_type` is `bit` otherwise defaults to
1430
+ `cosine`. `bit` vectors only support `l2_norm` as their
1431
+ similarity metric. This parameter can only be specified when
1432
+ `index` is `true`.
1433
+ :arg meta: Metadata about the field.
1434
+ :arg properties:
1435
+ :arg ignore_above:
1436
+ :arg dynamic:
1437
+ :arg fields:
1438
+ :arg synthetic_source_keep:
1439
+ """
1440
+
1441
+ name = "dense_vector"
1442
+ _coerce = True
1443
+ _param_defs = {
1444
+ "properties": {"type": "field", "hash": True},
1445
+ "fields": {"type": "field", "hash": True},
1446
+ }
1447
+
1448
+ def __init__(
1449
+ self,
1450
+ *args: Any,
1451
+ dims: Union[int, "DefaultType"] = DEFAULT,
1452
+ element_type: Union[Literal["bit", "byte", "float"], "DefaultType"] = DEFAULT,
1453
+ index: Union[bool, "DefaultType"] = DEFAULT,
1454
+ index_options: Union[
1455
+ "types.DenseVectorIndexOptions", Dict[str, Any], "DefaultType"
1456
+ ] = DEFAULT,
1457
+ similarity: Union[
1458
+ Literal["cosine", "dot_product", "l2_norm", "max_inner_product"],
1459
+ "DefaultType",
1460
+ ] = DEFAULT,
1461
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1462
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1463
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1464
+ dynamic: Union[
1465
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1466
+ ] = DEFAULT,
1467
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1468
+ synthetic_source_keep: Union[
1469
+ Literal["none", "arrays", "all"], "DefaultType"
1470
+ ] = DEFAULT,
1471
+ **kwargs: Any,
1472
+ ):
1473
+ if dims is not DEFAULT:
1474
+ kwargs["dims"] = dims
1475
+ if element_type is not DEFAULT:
1476
+ kwargs["element_type"] = element_type
1477
+ if index is not DEFAULT:
1478
+ kwargs["index"] = index
1479
+ if index_options is not DEFAULT:
1480
+ kwargs["index_options"] = index_options
1481
+ if similarity is not DEFAULT:
1482
+ kwargs["similarity"] = similarity
1483
+ if meta is not DEFAULT:
1484
+ kwargs["meta"] = meta
1485
+ if properties is not DEFAULT:
1486
+ kwargs["properties"] = properties
1487
+ if ignore_above is not DEFAULT:
1488
+ kwargs["ignore_above"] = ignore_above
1489
+ if dynamic is not DEFAULT:
1490
+ kwargs["dynamic"] = dynamic
1491
+ if fields is not DEFAULT:
1492
+ kwargs["fields"] = fields
1493
+ if synthetic_source_keep is not DEFAULT:
1494
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1495
+ self._element_type = kwargs.get("element_type", "float")
1496
+ if self._element_type in ["float", "byte"]:
1497
+ kwargs["multi"] = True
1498
+ super().__init__(*args, **kwargs)
1499
+
1500
+ def _deserialize(self, data: Any) -> Any:
1501
+ if self._element_type == "float":
1502
+ return float(data)
1503
+ elif self._element_type == "byte":
1504
+ return int(data)
1505
+ return data
1506
+
1507
+
1508
+ class Double(Float):
1509
+ """
1510
+ :arg null_value:
1511
+ :arg boost:
1512
+ :arg coerce:
1513
+ :arg ignore_malformed:
1514
+ :arg index:
1515
+ :arg on_script_error:
1516
+ :arg script:
1517
+ :arg time_series_metric: For internal use by Elastic only. Marks the
1518
+ field as a time series dimension. Defaults to false.
1519
+ :arg time_series_dimension: For internal use by Elastic only. Marks
1520
+ the field as a time series dimension. Defaults to false.
1521
+ :arg doc_values:
1522
+ :arg copy_to:
1523
+ :arg store:
1524
+ :arg meta: Metadata about the field.
1525
+ :arg properties:
1526
+ :arg ignore_above:
1527
+ :arg dynamic:
1528
+ :arg fields:
1529
+ :arg synthetic_source_keep:
1530
+ """
1531
+
1532
+ name = "double"
1533
+ _param_defs = {
1534
+ "properties": {"type": "field", "hash": True},
1535
+ "fields": {"type": "field", "hash": True},
1536
+ }
1537
+
1538
+ def __init__(
1539
+ self,
1540
+ *args: Any,
1541
+ null_value: Union[float, "DefaultType"] = DEFAULT,
1542
+ boost: Union[float, "DefaultType"] = DEFAULT,
1543
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
1544
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
1545
+ index: Union[bool, "DefaultType"] = DEFAULT,
1546
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
1547
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
1548
+ time_series_metric: Union[
1549
+ Literal["gauge", "counter", "summary", "histogram", "position"],
1550
+ "DefaultType",
1551
+ ] = DEFAULT,
1552
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
1553
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1554
+ copy_to: Union[
1555
+ Union[str, "InstrumentedField"],
1556
+ Sequence[Union[str, "InstrumentedField"]],
1557
+ "DefaultType",
1558
+ ] = DEFAULT,
1559
+ store: Union[bool, "DefaultType"] = DEFAULT,
1560
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1561
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1562
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1563
+ dynamic: Union[
1564
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1565
+ ] = DEFAULT,
1566
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1567
+ synthetic_source_keep: Union[
1568
+ Literal["none", "arrays", "all"], "DefaultType"
1569
+ ] = DEFAULT,
1570
+ **kwargs: Any,
1571
+ ):
1572
+ if null_value is not DEFAULT:
1573
+ kwargs["null_value"] = null_value
1574
+ if boost is not DEFAULT:
1575
+ kwargs["boost"] = boost
1576
+ if coerce is not DEFAULT:
1577
+ kwargs["coerce"] = coerce
1578
+ if ignore_malformed is not DEFAULT:
1579
+ kwargs["ignore_malformed"] = ignore_malformed
1580
+ if index is not DEFAULT:
1581
+ kwargs["index"] = index
1582
+ if on_script_error is not DEFAULT:
1583
+ kwargs["on_script_error"] = on_script_error
1584
+ if script is not DEFAULT:
1585
+ kwargs["script"] = script
1586
+ if time_series_metric is not DEFAULT:
1587
+ kwargs["time_series_metric"] = time_series_metric
1588
+ if time_series_dimension is not DEFAULT:
1589
+ kwargs["time_series_dimension"] = time_series_dimension
1590
+ if doc_values is not DEFAULT:
1591
+ kwargs["doc_values"] = doc_values
1592
+ if copy_to is not DEFAULT:
1593
+ kwargs["copy_to"] = str(copy_to)
1594
+ if store is not DEFAULT:
1595
+ kwargs["store"] = store
1596
+ if meta is not DEFAULT:
1597
+ kwargs["meta"] = meta
1598
+ if properties is not DEFAULT:
1599
+ kwargs["properties"] = properties
1600
+ if ignore_above is not DEFAULT:
1601
+ kwargs["ignore_above"] = ignore_above
1602
+ if dynamic is not DEFAULT:
1603
+ kwargs["dynamic"] = dynamic
1604
+ if fields is not DEFAULT:
1605
+ kwargs["fields"] = fields
1606
+ if synthetic_source_keep is not DEFAULT:
1607
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1608
+ super().__init__(*args, **kwargs)
1609
+
1610
+
1611
+ class DoubleRange(RangeField):
1612
+ """
1613
+ :arg boost:
1614
+ :arg coerce:
1615
+ :arg index:
1616
+ :arg doc_values:
1617
+ :arg copy_to:
1618
+ :arg store:
1619
+ :arg meta: Metadata about the field.
1620
+ :arg properties:
1621
+ :arg ignore_above:
1622
+ :arg dynamic:
1623
+ :arg fields:
1624
+ :arg synthetic_source_keep:
1625
+ """
1626
+
1627
+ name = "double_range"
1628
+ _core_field = Double()
1629
+ _param_defs = {
1630
+ "properties": {"type": "field", "hash": True},
1631
+ "fields": {"type": "field", "hash": True},
1632
+ }
1633
+
1634
+ def __init__(
1635
+ self,
1636
+ *args: Any,
1637
+ boost: Union[float, "DefaultType"] = DEFAULT,
1638
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
1639
+ index: Union[bool, "DefaultType"] = DEFAULT,
1640
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1641
+ copy_to: Union[
1642
+ Union[str, "InstrumentedField"],
1643
+ Sequence[Union[str, "InstrumentedField"]],
1644
+ "DefaultType",
1645
+ ] = DEFAULT,
1646
+ store: Union[bool, "DefaultType"] = DEFAULT,
1647
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1648
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1649
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1650
+ dynamic: Union[
1651
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1652
+ ] = DEFAULT,
1653
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1654
+ synthetic_source_keep: Union[
1655
+ Literal["none", "arrays", "all"], "DefaultType"
1656
+ ] = DEFAULT,
1657
+ **kwargs: Any,
1658
+ ):
1659
+ if boost is not DEFAULT:
1660
+ kwargs["boost"] = boost
1661
+ if coerce is not DEFAULT:
1662
+ kwargs["coerce"] = coerce
1663
+ if index is not DEFAULT:
1664
+ kwargs["index"] = index
1665
+ if doc_values is not DEFAULT:
1666
+ kwargs["doc_values"] = doc_values
1667
+ if copy_to is not DEFAULT:
1668
+ kwargs["copy_to"] = str(copy_to)
1669
+ if store is not DEFAULT:
1670
+ kwargs["store"] = store
1671
+ if meta is not DEFAULT:
1672
+ kwargs["meta"] = meta
1673
+ if properties is not DEFAULT:
1674
+ kwargs["properties"] = properties
1675
+ if ignore_above is not DEFAULT:
1676
+ kwargs["ignore_above"] = ignore_above
1677
+ if dynamic is not DEFAULT:
1678
+ kwargs["dynamic"] = dynamic
1679
+ if fields is not DEFAULT:
1680
+ kwargs["fields"] = fields
1681
+ if synthetic_source_keep is not DEFAULT:
1682
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1683
+ super().__init__(*args, **kwargs)
1684
+
1685
+
1686
+ class Flattened(Field):
1687
+ """
1688
+ :arg boost:
1689
+ :arg depth_limit:
1690
+ :arg doc_values:
1691
+ :arg eager_global_ordinals:
1692
+ :arg index:
1693
+ :arg index_options:
1694
+ :arg null_value:
1695
+ :arg similarity:
1696
+ :arg split_queries_on_whitespace:
1697
+ :arg meta: Metadata about the field.
1698
+ :arg properties:
1699
+ :arg ignore_above:
1700
+ :arg dynamic:
1701
+ :arg fields:
1702
+ :arg synthetic_source_keep:
1703
+ """
1704
+
1705
+ name = "flattened"
1706
+ _param_defs = {
1707
+ "properties": {"type": "field", "hash": True},
1708
+ "fields": {"type": "field", "hash": True},
1709
+ }
1710
+
1711
+ def __init__(
1712
+ self,
1713
+ *args: Any,
1714
+ boost: Union[float, "DefaultType"] = DEFAULT,
1715
+ depth_limit: Union[int, "DefaultType"] = DEFAULT,
1716
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1717
+ eager_global_ordinals: Union[bool, "DefaultType"] = DEFAULT,
1718
+ index: Union[bool, "DefaultType"] = DEFAULT,
1719
+ index_options: Union[
1720
+ Literal["docs", "freqs", "positions", "offsets"], "DefaultType"
1721
+ ] = DEFAULT,
1722
+ null_value: Union[str, "DefaultType"] = DEFAULT,
1723
+ similarity: Union[str, "DefaultType"] = DEFAULT,
1724
+ split_queries_on_whitespace: Union[bool, "DefaultType"] = DEFAULT,
1725
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1726
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1727
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1728
+ dynamic: Union[
1729
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1730
+ ] = DEFAULT,
1731
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1732
+ synthetic_source_keep: Union[
1733
+ Literal["none", "arrays", "all"], "DefaultType"
1734
+ ] = DEFAULT,
1735
+ **kwargs: Any,
1736
+ ):
1737
+ if boost is not DEFAULT:
1738
+ kwargs["boost"] = boost
1739
+ if depth_limit is not DEFAULT:
1740
+ kwargs["depth_limit"] = depth_limit
1741
+ if doc_values is not DEFAULT:
1742
+ kwargs["doc_values"] = doc_values
1743
+ if eager_global_ordinals is not DEFAULT:
1744
+ kwargs["eager_global_ordinals"] = eager_global_ordinals
1745
+ if index is not DEFAULT:
1746
+ kwargs["index"] = index
1747
+ if index_options is not DEFAULT:
1748
+ kwargs["index_options"] = index_options
1749
+ if null_value is not DEFAULT:
1750
+ kwargs["null_value"] = null_value
1751
+ if similarity is not DEFAULT:
1752
+ kwargs["similarity"] = similarity
1753
+ if split_queries_on_whitespace is not DEFAULT:
1754
+ kwargs["split_queries_on_whitespace"] = split_queries_on_whitespace
1755
+ if meta is not DEFAULT:
1756
+ kwargs["meta"] = meta
1757
+ if properties is not DEFAULT:
1758
+ kwargs["properties"] = properties
1759
+ if ignore_above is not DEFAULT:
1760
+ kwargs["ignore_above"] = ignore_above
1761
+ if dynamic is not DEFAULT:
1762
+ kwargs["dynamic"] = dynamic
1763
+ if fields is not DEFAULT:
1764
+ kwargs["fields"] = fields
1765
+ if synthetic_source_keep is not DEFAULT:
1766
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1767
+ super().__init__(*args, **kwargs)
1768
+
1769
+
1770
+ class FloatRange(RangeField):
1771
+ """
1772
+ :arg boost:
1773
+ :arg coerce:
1774
+ :arg index:
1775
+ :arg doc_values:
1776
+ :arg copy_to:
1777
+ :arg store:
1778
+ :arg meta: Metadata about the field.
1779
+ :arg properties:
1780
+ :arg ignore_above:
1781
+ :arg dynamic:
1782
+ :arg fields:
1783
+ :arg synthetic_source_keep:
1784
+ """
1785
+
1786
+ name = "float_range"
1787
+ _core_field = Float()
1788
+ _param_defs = {
1789
+ "properties": {"type": "field", "hash": True},
1790
+ "fields": {"type": "field", "hash": True},
1791
+ }
1792
+
1793
+ def __init__(
1794
+ self,
1795
+ *args: Any,
1796
+ boost: Union[float, "DefaultType"] = DEFAULT,
1797
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
1798
+ index: Union[bool, "DefaultType"] = DEFAULT,
1799
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1800
+ copy_to: Union[
1801
+ Union[str, "InstrumentedField"],
1802
+ Sequence[Union[str, "InstrumentedField"]],
1803
+ "DefaultType",
1804
+ ] = DEFAULT,
1805
+ store: Union[bool, "DefaultType"] = DEFAULT,
1806
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1807
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1808
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1809
+ dynamic: Union[
1810
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1811
+ ] = DEFAULT,
1812
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1813
+ synthetic_source_keep: Union[
1814
+ Literal["none", "arrays", "all"], "DefaultType"
1815
+ ] = DEFAULT,
1816
+ **kwargs: Any,
1817
+ ):
1818
+ if boost is not DEFAULT:
1819
+ kwargs["boost"] = boost
1820
+ if coerce is not DEFAULT:
1821
+ kwargs["coerce"] = coerce
1822
+ if index is not DEFAULT:
1823
+ kwargs["index"] = index
1824
+ if doc_values is not DEFAULT:
1825
+ kwargs["doc_values"] = doc_values
1826
+ if copy_to is not DEFAULT:
1827
+ kwargs["copy_to"] = str(copy_to)
1828
+ if store is not DEFAULT:
1829
+ kwargs["store"] = store
1830
+ if meta is not DEFAULT:
1831
+ kwargs["meta"] = meta
1832
+ if properties is not DEFAULT:
1833
+ kwargs["properties"] = properties
1834
+ if ignore_above is not DEFAULT:
1835
+ kwargs["ignore_above"] = ignore_above
1836
+ if dynamic is not DEFAULT:
1837
+ kwargs["dynamic"] = dynamic
1838
+ if fields is not DEFAULT:
1839
+ kwargs["fields"] = fields
1840
+ if synthetic_source_keep is not DEFAULT:
1841
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1842
+ super().__init__(*args, **kwargs)
1843
+
1844
+
1845
+ class GeoPoint(Field):
1846
+ """
1847
+ :arg ignore_malformed:
1848
+ :arg ignore_z_value:
1849
+ :arg null_value:
1850
+ :arg index:
1851
+ :arg on_script_error:
1852
+ :arg script:
1853
+ :arg doc_values:
1854
+ :arg copy_to:
1855
+ :arg store:
1856
+ :arg meta: Metadata about the field.
1857
+ :arg properties:
1858
+ :arg ignore_above:
1859
+ :arg dynamic:
1860
+ :arg fields:
1861
+ :arg synthetic_source_keep:
1862
+ """
1863
+
1864
+ name = "geo_point"
1865
+ _param_defs = {
1866
+ "properties": {"type": "field", "hash": True},
1867
+ "fields": {"type": "field", "hash": True},
1868
+ }
1869
+
1870
+ def __init__(
1871
+ self,
1872
+ *args: Any,
1873
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
1874
+ ignore_z_value: Union[bool, "DefaultType"] = DEFAULT,
1875
+ null_value: Union[
1876
+ "types.LatLonGeoLocation",
1877
+ "types.GeoHashLocation",
1878
+ Sequence[float],
1879
+ str,
1880
+ Dict[str, Any],
1881
+ "DefaultType",
1882
+ ] = DEFAULT,
1883
+ index: Union[bool, "DefaultType"] = DEFAULT,
1884
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
1885
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
1886
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1887
+ copy_to: Union[
1888
+ Union[str, "InstrumentedField"],
1889
+ Sequence[Union[str, "InstrumentedField"]],
1890
+ "DefaultType",
1891
+ ] = DEFAULT,
1892
+ store: Union[bool, "DefaultType"] = DEFAULT,
1893
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1894
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1895
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1896
+ dynamic: Union[
1897
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1898
+ ] = DEFAULT,
1899
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1900
+ synthetic_source_keep: Union[
1901
+ Literal["none", "arrays", "all"], "DefaultType"
1902
+ ] = DEFAULT,
1903
+ **kwargs: Any,
1904
+ ):
1905
+ if ignore_malformed is not DEFAULT:
1906
+ kwargs["ignore_malformed"] = ignore_malformed
1907
+ if ignore_z_value is not DEFAULT:
1908
+ kwargs["ignore_z_value"] = ignore_z_value
1909
+ if null_value is not DEFAULT:
1910
+ kwargs["null_value"] = null_value
1911
+ if index is not DEFAULT:
1912
+ kwargs["index"] = index
1913
+ if on_script_error is not DEFAULT:
1914
+ kwargs["on_script_error"] = on_script_error
1915
+ if script is not DEFAULT:
1916
+ kwargs["script"] = script
1917
+ if doc_values is not DEFAULT:
1918
+ kwargs["doc_values"] = doc_values
1919
+ if copy_to is not DEFAULT:
1920
+ kwargs["copy_to"] = str(copy_to)
1921
+ if store is not DEFAULT:
1922
+ kwargs["store"] = store
1923
+ if meta is not DEFAULT:
1924
+ kwargs["meta"] = meta
1925
+ if properties is not DEFAULT:
1926
+ kwargs["properties"] = properties
1927
+ if ignore_above is not DEFAULT:
1928
+ kwargs["ignore_above"] = ignore_above
1929
+ if dynamic is not DEFAULT:
1930
+ kwargs["dynamic"] = dynamic
1931
+ if fields is not DEFAULT:
1932
+ kwargs["fields"] = fields
1933
+ if synthetic_source_keep is not DEFAULT:
1934
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
1935
+ super().__init__(*args, **kwargs)
1936
+
1937
+
1938
+ class GeoShape(Field):
1939
+ """
1940
+ The `geo_shape` data type facilitates the indexing of and searching
1941
+ with arbitrary geo shapes such as rectangles and polygons.
1942
+
1943
+ :arg coerce:
1944
+ :arg ignore_malformed:
1945
+ :arg ignore_z_value:
1946
+ :arg index:
1947
+ :arg orientation:
1948
+ :arg strategy:
1949
+ :arg doc_values:
1950
+ :arg copy_to:
1951
+ :arg store:
1952
+ :arg meta: Metadata about the field.
1953
+ :arg properties:
1954
+ :arg ignore_above:
1955
+ :arg dynamic:
1956
+ :arg fields:
1957
+ :arg synthetic_source_keep:
1958
+ """
1959
+
1960
+ name = "geo_shape"
1961
+ _param_defs = {
1962
+ "properties": {"type": "field", "hash": True},
1963
+ "fields": {"type": "field", "hash": True},
1964
+ }
1965
+
1966
+ def __init__(
1967
+ self,
1968
+ *args: Any,
1969
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
1970
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
1971
+ ignore_z_value: Union[bool, "DefaultType"] = DEFAULT,
1972
+ index: Union[bool, "DefaultType"] = DEFAULT,
1973
+ orientation: Union[Literal["right", "left"], "DefaultType"] = DEFAULT,
1974
+ strategy: Union[Literal["recursive", "term"], "DefaultType"] = DEFAULT,
1975
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
1976
+ copy_to: Union[
1977
+ Union[str, "InstrumentedField"],
1978
+ Sequence[Union[str, "InstrumentedField"]],
1979
+ "DefaultType",
1980
+ ] = DEFAULT,
1981
+ store: Union[bool, "DefaultType"] = DEFAULT,
1982
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
1983
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1984
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
1985
+ dynamic: Union[
1986
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
1987
+ ] = DEFAULT,
1988
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
1989
+ synthetic_source_keep: Union[
1990
+ Literal["none", "arrays", "all"], "DefaultType"
1991
+ ] = DEFAULT,
1992
+ **kwargs: Any,
1993
+ ):
1994
+ if coerce is not DEFAULT:
1995
+ kwargs["coerce"] = coerce
1996
+ if ignore_malformed is not DEFAULT:
1997
+ kwargs["ignore_malformed"] = ignore_malformed
1998
+ if ignore_z_value is not DEFAULT:
1999
+ kwargs["ignore_z_value"] = ignore_z_value
2000
+ if index is not DEFAULT:
2001
+ kwargs["index"] = index
2002
+ if orientation is not DEFAULT:
2003
+ kwargs["orientation"] = orientation
2004
+ if strategy is not DEFAULT:
2005
+ kwargs["strategy"] = strategy
2006
+ if doc_values is not DEFAULT:
2007
+ kwargs["doc_values"] = doc_values
2008
+ if copy_to is not DEFAULT:
2009
+ kwargs["copy_to"] = str(copy_to)
2010
+ if store is not DEFAULT:
2011
+ kwargs["store"] = store
2012
+ if meta is not DEFAULT:
2013
+ kwargs["meta"] = meta
2014
+ if properties is not DEFAULT:
2015
+ kwargs["properties"] = properties
2016
+ if ignore_above is not DEFAULT:
2017
+ kwargs["ignore_above"] = ignore_above
2018
+ if dynamic is not DEFAULT:
2019
+ kwargs["dynamic"] = dynamic
2020
+ if fields is not DEFAULT:
2021
+ kwargs["fields"] = fields
2022
+ if synthetic_source_keep is not DEFAULT:
2023
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2024
+ super().__init__(*args, **kwargs)
2025
+
2026
+
2027
+ class HalfFloat(Float):
2028
+ """
2029
+ :arg null_value:
2030
+ :arg boost:
2031
+ :arg coerce:
2032
+ :arg ignore_malformed:
2033
+ :arg index:
2034
+ :arg on_script_error:
2035
+ :arg script:
2036
+ :arg time_series_metric: For internal use by Elastic only. Marks the
2037
+ field as a time series dimension. Defaults to false.
2038
+ :arg time_series_dimension: For internal use by Elastic only. Marks
2039
+ the field as a time series dimension. Defaults to false.
2040
+ :arg doc_values:
2041
+ :arg copy_to:
2042
+ :arg store:
2043
+ :arg meta: Metadata about the field.
2044
+ :arg properties:
2045
+ :arg ignore_above:
2046
+ :arg dynamic:
2047
+ :arg fields:
2048
+ :arg synthetic_source_keep:
2049
+ """
2050
+
2051
+ name = "half_float"
2052
+ _param_defs = {
2053
+ "properties": {"type": "field", "hash": True},
2054
+ "fields": {"type": "field", "hash": True},
2055
+ }
2056
+
2057
+ def __init__(
2058
+ self,
2059
+ *args: Any,
2060
+ null_value: Union[float, "DefaultType"] = DEFAULT,
2061
+ boost: Union[float, "DefaultType"] = DEFAULT,
2062
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
2063
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
2064
+ index: Union[bool, "DefaultType"] = DEFAULT,
2065
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
2066
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
2067
+ time_series_metric: Union[
2068
+ Literal["gauge", "counter", "summary", "histogram", "position"],
2069
+ "DefaultType",
2070
+ ] = DEFAULT,
2071
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
2072
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
2073
+ copy_to: Union[
2074
+ Union[str, "InstrumentedField"],
2075
+ Sequence[Union[str, "InstrumentedField"]],
2076
+ "DefaultType",
2077
+ ] = DEFAULT,
2078
+ store: Union[bool, "DefaultType"] = DEFAULT,
2079
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2080
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2081
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2082
+ dynamic: Union[
2083
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2084
+ ] = DEFAULT,
2085
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2086
+ synthetic_source_keep: Union[
2087
+ Literal["none", "arrays", "all"], "DefaultType"
2088
+ ] = DEFAULT,
2089
+ **kwargs: Any,
2090
+ ):
2091
+ if null_value is not DEFAULT:
2092
+ kwargs["null_value"] = null_value
2093
+ if boost is not DEFAULT:
2094
+ kwargs["boost"] = boost
2095
+ if coerce is not DEFAULT:
2096
+ kwargs["coerce"] = coerce
2097
+ if ignore_malformed is not DEFAULT:
2098
+ kwargs["ignore_malformed"] = ignore_malformed
2099
+ if index is not DEFAULT:
2100
+ kwargs["index"] = index
2101
+ if on_script_error is not DEFAULT:
2102
+ kwargs["on_script_error"] = on_script_error
2103
+ if script is not DEFAULT:
2104
+ kwargs["script"] = script
2105
+ if time_series_metric is not DEFAULT:
2106
+ kwargs["time_series_metric"] = time_series_metric
2107
+ if time_series_dimension is not DEFAULT:
2108
+ kwargs["time_series_dimension"] = time_series_dimension
2109
+ if doc_values is not DEFAULT:
2110
+ kwargs["doc_values"] = doc_values
2111
+ if copy_to is not DEFAULT:
2112
+ kwargs["copy_to"] = str(copy_to)
2113
+ if store is not DEFAULT:
2114
+ kwargs["store"] = store
2115
+ if meta is not DEFAULT:
2116
+ kwargs["meta"] = meta
2117
+ if properties is not DEFAULT:
2118
+ kwargs["properties"] = properties
2119
+ if ignore_above is not DEFAULT:
2120
+ kwargs["ignore_above"] = ignore_above
2121
+ if dynamic is not DEFAULT:
2122
+ kwargs["dynamic"] = dynamic
2123
+ if fields is not DEFAULT:
2124
+ kwargs["fields"] = fields
2125
+ if synthetic_source_keep is not DEFAULT:
2126
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2127
+ super().__init__(*args, **kwargs)
2128
+
2129
+
2130
+ class Histogram(Field):
2131
+ """
2132
+ :arg ignore_malformed:
2133
+ :arg meta: Metadata about the field.
2134
+ :arg properties:
2135
+ :arg ignore_above:
2136
+ :arg dynamic:
2137
+ :arg fields:
2138
+ :arg synthetic_source_keep:
2139
+ """
2140
+
2141
+ name = "histogram"
2142
+ _param_defs = {
2143
+ "properties": {"type": "field", "hash": True},
2144
+ "fields": {"type": "field", "hash": True},
2145
+ }
2146
+
2147
+ def __init__(
2148
+ self,
2149
+ *args: Any,
2150
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
2151
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2152
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2153
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2154
+ dynamic: Union[
2155
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2156
+ ] = DEFAULT,
2157
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2158
+ synthetic_source_keep: Union[
2159
+ Literal["none", "arrays", "all"], "DefaultType"
2160
+ ] = DEFAULT,
2161
+ **kwargs: Any,
2162
+ ):
2163
+ if ignore_malformed is not DEFAULT:
2164
+ kwargs["ignore_malformed"] = ignore_malformed
2165
+ if meta is not DEFAULT:
2166
+ kwargs["meta"] = meta
2167
+ if properties is not DEFAULT:
2168
+ kwargs["properties"] = properties
2169
+ if ignore_above is not DEFAULT:
2170
+ kwargs["ignore_above"] = ignore_above
2171
+ if dynamic is not DEFAULT:
2172
+ kwargs["dynamic"] = dynamic
2173
+ if fields is not DEFAULT:
2174
+ kwargs["fields"] = fields
2175
+ if synthetic_source_keep is not DEFAULT:
2176
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2177
+ super().__init__(*args, **kwargs)
2178
+
2179
+
2180
+ class IcuCollationKeyword(Field):
2181
+ """
2182
+ :arg norms:
2183
+ :arg index_options:
2184
+ :arg index: Should the field be searchable?
2185
+ :arg null_value: Accepts a string value which is substituted for any
2186
+ explicit null values. Defaults to null, which means the field is
2187
+ treated as missing.
2188
+ :arg rules:
2189
+ :arg language:
2190
+ :arg country:
2191
+ :arg variant:
2192
+ :arg strength:
2193
+ :arg decomposition:
2194
+ :arg alternate:
2195
+ :arg case_level:
2196
+ :arg case_first:
2197
+ :arg numeric:
2198
+ :arg variable_top:
2199
+ :arg hiragana_quaternary_mode:
2200
+ :arg doc_values:
2201
+ :arg copy_to:
2202
+ :arg store:
2203
+ :arg meta: Metadata about the field.
2204
+ :arg properties:
2205
+ :arg ignore_above:
2206
+ :arg dynamic:
2207
+ :arg fields:
2208
+ :arg synthetic_source_keep:
2209
+ """
2210
+
2211
+ name = "icu_collation_keyword"
2212
+ _param_defs = {
2213
+ "properties": {"type": "field", "hash": True},
2214
+ "fields": {"type": "field", "hash": True},
2215
+ }
2216
+
2217
+ def __init__(
2218
+ self,
2219
+ *args: Any,
2220
+ norms: Union[bool, "DefaultType"] = DEFAULT,
2221
+ index_options: Union[
2222
+ Literal["docs", "freqs", "positions", "offsets"], "DefaultType"
2223
+ ] = DEFAULT,
2224
+ index: Union[bool, "DefaultType"] = DEFAULT,
2225
+ null_value: Union[str, "DefaultType"] = DEFAULT,
2226
+ rules: Union[str, "DefaultType"] = DEFAULT,
2227
+ language: Union[str, "DefaultType"] = DEFAULT,
2228
+ country: Union[str, "DefaultType"] = DEFAULT,
2229
+ variant: Union[str, "DefaultType"] = DEFAULT,
2230
+ strength: Union[
2231
+ Literal["primary", "secondary", "tertiary", "quaternary", "identical"],
2232
+ "DefaultType",
2233
+ ] = DEFAULT,
2234
+ decomposition: Union[Literal["no", "identical"], "DefaultType"] = DEFAULT,
2235
+ alternate: Union[Literal["shifted", "non-ignorable"], "DefaultType"] = DEFAULT,
2236
+ case_level: Union[bool, "DefaultType"] = DEFAULT,
2237
+ case_first: Union[Literal["lower", "upper"], "DefaultType"] = DEFAULT,
2238
+ numeric: Union[bool, "DefaultType"] = DEFAULT,
2239
+ variable_top: Union[str, "DefaultType"] = DEFAULT,
2240
+ hiragana_quaternary_mode: Union[bool, "DefaultType"] = DEFAULT,
2241
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
2242
+ copy_to: Union[
2243
+ Union[str, "InstrumentedField"],
2244
+ Sequence[Union[str, "InstrumentedField"]],
2245
+ "DefaultType",
2246
+ ] = DEFAULT,
2247
+ store: Union[bool, "DefaultType"] = DEFAULT,
2248
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2249
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2250
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2251
+ dynamic: Union[
2252
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2253
+ ] = DEFAULT,
2254
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2255
+ synthetic_source_keep: Union[
2256
+ Literal["none", "arrays", "all"], "DefaultType"
2257
+ ] = DEFAULT,
2258
+ **kwargs: Any,
2259
+ ):
2260
+ if norms is not DEFAULT:
2261
+ kwargs["norms"] = norms
2262
+ if index_options is not DEFAULT:
2263
+ kwargs["index_options"] = index_options
2264
+ if index is not DEFAULT:
2265
+ kwargs["index"] = index
2266
+ if null_value is not DEFAULT:
2267
+ kwargs["null_value"] = null_value
2268
+ if rules is not DEFAULT:
2269
+ kwargs["rules"] = rules
2270
+ if language is not DEFAULT:
2271
+ kwargs["language"] = language
2272
+ if country is not DEFAULT:
2273
+ kwargs["country"] = country
2274
+ if variant is not DEFAULT:
2275
+ kwargs["variant"] = variant
2276
+ if strength is not DEFAULT:
2277
+ kwargs["strength"] = strength
2278
+ if decomposition is not DEFAULT:
2279
+ kwargs["decomposition"] = decomposition
2280
+ if alternate is not DEFAULT:
2281
+ kwargs["alternate"] = alternate
2282
+ if case_level is not DEFAULT:
2283
+ kwargs["case_level"] = case_level
2284
+ if case_first is not DEFAULT:
2285
+ kwargs["case_first"] = case_first
2286
+ if numeric is not DEFAULT:
2287
+ kwargs["numeric"] = numeric
2288
+ if variable_top is not DEFAULT:
2289
+ kwargs["variable_top"] = variable_top
2290
+ if hiragana_quaternary_mode is not DEFAULT:
2291
+ kwargs["hiragana_quaternary_mode"] = hiragana_quaternary_mode
2292
+ if doc_values is not DEFAULT:
2293
+ kwargs["doc_values"] = doc_values
2294
+ if copy_to is not DEFAULT:
2295
+ kwargs["copy_to"] = str(copy_to)
2296
+ if store is not DEFAULT:
2297
+ kwargs["store"] = store
2298
+ if meta is not DEFAULT:
2299
+ kwargs["meta"] = meta
2300
+ if properties is not DEFAULT:
2301
+ kwargs["properties"] = properties
2302
+ if ignore_above is not DEFAULT:
2303
+ kwargs["ignore_above"] = ignore_above
2304
+ if dynamic is not DEFAULT:
2305
+ kwargs["dynamic"] = dynamic
2306
+ if fields is not DEFAULT:
2307
+ kwargs["fields"] = fields
2308
+ if synthetic_source_keep is not DEFAULT:
2309
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2310
+ super().__init__(*args, **kwargs)
2311
+
2312
+
2313
+ class IntegerRange(RangeField):
2314
+ """
2315
+ :arg boost:
2316
+ :arg coerce:
2317
+ :arg index:
2318
+ :arg doc_values:
2319
+ :arg copy_to:
2320
+ :arg store:
2321
+ :arg meta: Metadata about the field.
2322
+ :arg properties:
2323
+ :arg ignore_above:
2324
+ :arg dynamic:
2325
+ :arg fields:
2326
+ :arg synthetic_source_keep:
2327
+ """
2328
+
2329
+ name = "integer_range"
2330
+ _core_field = Integer()
2331
+ _param_defs = {
2332
+ "properties": {"type": "field", "hash": True},
2333
+ "fields": {"type": "field", "hash": True},
2334
+ }
2335
+
2336
+ def __init__(
2337
+ self,
2338
+ *args: Any,
2339
+ boost: Union[float, "DefaultType"] = DEFAULT,
2340
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
2341
+ index: Union[bool, "DefaultType"] = DEFAULT,
2342
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
2343
+ copy_to: Union[
2344
+ Union[str, "InstrumentedField"],
2345
+ Sequence[Union[str, "InstrumentedField"]],
2346
+ "DefaultType",
2347
+ ] = DEFAULT,
2348
+ store: Union[bool, "DefaultType"] = DEFAULT,
2349
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2350
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2351
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2352
+ dynamic: Union[
2353
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2354
+ ] = DEFAULT,
2355
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2356
+ synthetic_source_keep: Union[
2357
+ Literal["none", "arrays", "all"], "DefaultType"
2358
+ ] = DEFAULT,
2359
+ **kwargs: Any,
2360
+ ):
2361
+ if boost is not DEFAULT:
2362
+ kwargs["boost"] = boost
2363
+ if coerce is not DEFAULT:
2364
+ kwargs["coerce"] = coerce
2365
+ if index is not DEFAULT:
2366
+ kwargs["index"] = index
2367
+ if doc_values is not DEFAULT:
2368
+ kwargs["doc_values"] = doc_values
2369
+ if copy_to is not DEFAULT:
2370
+ kwargs["copy_to"] = str(copy_to)
2371
+ if store is not DEFAULT:
2372
+ kwargs["store"] = store
2373
+ if meta is not DEFAULT:
2374
+ kwargs["meta"] = meta
2375
+ if properties is not DEFAULT:
2376
+ kwargs["properties"] = properties
2377
+ if ignore_above is not DEFAULT:
2378
+ kwargs["ignore_above"] = ignore_above
2379
+ if dynamic is not DEFAULT:
2380
+ kwargs["dynamic"] = dynamic
2381
+ if fields is not DEFAULT:
2382
+ kwargs["fields"] = fields
2383
+ if synthetic_source_keep is not DEFAULT:
2384
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2385
+ super().__init__(*args, **kwargs)
2386
+
2387
+
2388
+ class Ip(Field):
2389
+ """
2390
+ :arg boost:
2391
+ :arg index:
2392
+ :arg ignore_malformed:
2393
+ :arg null_value:
2394
+ :arg on_script_error:
2395
+ :arg script:
2396
+ :arg time_series_dimension: For internal use by Elastic only. Marks
2397
+ the field as a time series dimension. Defaults to false.
2398
+ :arg doc_values:
2399
+ :arg copy_to:
2400
+ :arg store:
2401
+ :arg meta: Metadata about the field.
2402
+ :arg properties:
2403
+ :arg ignore_above:
2404
+ :arg dynamic:
2405
+ :arg fields:
2406
+ :arg synthetic_source_keep:
2407
+ """
2408
+
2409
+ name = "ip"
2410
+ _coerce = True
2411
+ _param_defs = {
2412
+ "properties": {"type": "field", "hash": True},
2413
+ "fields": {"type": "field", "hash": True},
2414
+ }
2415
+
2416
+ def __init__(
2417
+ self,
2418
+ *args: Any,
2419
+ boost: Union[float, "DefaultType"] = DEFAULT,
2420
+ index: Union[bool, "DefaultType"] = DEFAULT,
2421
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
2422
+ null_value: Union[str, "DefaultType"] = DEFAULT,
2423
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
2424
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
2425
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
2426
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
2427
+ copy_to: Union[
2428
+ Union[str, "InstrumentedField"],
2429
+ Sequence[Union[str, "InstrumentedField"]],
2430
+ "DefaultType",
2431
+ ] = DEFAULT,
2432
+ store: Union[bool, "DefaultType"] = DEFAULT,
2433
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2434
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2435
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2436
+ dynamic: Union[
2437
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2438
+ ] = DEFAULT,
2439
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2440
+ synthetic_source_keep: Union[
2441
+ Literal["none", "arrays", "all"], "DefaultType"
2442
+ ] = DEFAULT,
2443
+ **kwargs: Any,
2444
+ ):
2445
+ if boost is not DEFAULT:
2446
+ kwargs["boost"] = boost
2447
+ if index is not DEFAULT:
2448
+ kwargs["index"] = index
2449
+ if ignore_malformed is not DEFAULT:
2450
+ kwargs["ignore_malformed"] = ignore_malformed
2451
+ if null_value is not DEFAULT:
2452
+ kwargs["null_value"] = null_value
2453
+ if on_script_error is not DEFAULT:
2454
+ kwargs["on_script_error"] = on_script_error
2455
+ if script is not DEFAULT:
2456
+ kwargs["script"] = script
2457
+ if time_series_dimension is not DEFAULT:
2458
+ kwargs["time_series_dimension"] = time_series_dimension
2459
+ if doc_values is not DEFAULT:
2460
+ kwargs["doc_values"] = doc_values
2461
+ if copy_to is not DEFAULT:
2462
+ kwargs["copy_to"] = str(copy_to)
2463
+ if store is not DEFAULT:
2464
+ kwargs["store"] = store
2465
+ if meta is not DEFAULT:
2466
+ kwargs["meta"] = meta
2467
+ if properties is not DEFAULT:
2468
+ kwargs["properties"] = properties
2469
+ if ignore_above is not DEFAULT:
2470
+ kwargs["ignore_above"] = ignore_above
2471
+ if dynamic is not DEFAULT:
2472
+ kwargs["dynamic"] = dynamic
2473
+ if fields is not DEFAULT:
2474
+ kwargs["fields"] = fields
2475
+ if synthetic_source_keep is not DEFAULT:
2476
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2477
+ super().__init__(*args, **kwargs)
2478
+
2479
+ def _deserialize(self, data: Any) -> Union["IPv4Address", "IPv6Address"]:
2480
+ # the ipaddress library for pypy only accepts unicode.
2481
+ return ipaddress.ip_address(unicode(data))
2482
+
2483
+ def _serialize(self, data: Any) -> Optional[str]:
2484
+ if data is None:
2485
+ return None
2486
+ return str(data)
2487
+
2488
+
2489
+ class IpRange(Field):
2490
+ """
2491
+ :arg boost:
2492
+ :arg coerce:
2493
+ :arg index:
2494
+ :arg doc_values:
2495
+ :arg copy_to:
2496
+ :arg store:
2497
+ :arg meta: Metadata about the field.
2498
+ :arg properties:
2499
+ :arg ignore_above:
2500
+ :arg dynamic:
2501
+ :arg fields:
2502
+ :arg synthetic_source_keep:
2503
+ """
2504
+
2505
+ name = "ip_range"
2506
+ _core_field = Ip()
2507
+ _param_defs = {
2508
+ "properties": {"type": "field", "hash": True},
2509
+ "fields": {"type": "field", "hash": True},
2510
+ }
2511
+
2512
+ def __init__(
2513
+ self,
2514
+ *args: Any,
2515
+ boost: Union[float, "DefaultType"] = DEFAULT,
2516
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
2517
+ index: Union[bool, "DefaultType"] = DEFAULT,
2518
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
2519
+ copy_to: Union[
2520
+ Union[str, "InstrumentedField"],
2521
+ Sequence[Union[str, "InstrumentedField"]],
2522
+ "DefaultType",
2523
+ ] = DEFAULT,
2524
+ store: Union[bool, "DefaultType"] = DEFAULT,
2525
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2526
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2527
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2528
+ dynamic: Union[
2529
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2530
+ ] = DEFAULT,
2531
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2532
+ synthetic_source_keep: Union[
2533
+ Literal["none", "arrays", "all"], "DefaultType"
2534
+ ] = DEFAULT,
2535
+ **kwargs: Any,
2536
+ ):
2537
+ if boost is not DEFAULT:
2538
+ kwargs["boost"] = boost
2539
+ if coerce is not DEFAULT:
2540
+ kwargs["coerce"] = coerce
2541
+ if index is not DEFAULT:
2542
+ kwargs["index"] = index
2543
+ if doc_values is not DEFAULT:
2544
+ kwargs["doc_values"] = doc_values
2545
+ if copy_to is not DEFAULT:
2546
+ kwargs["copy_to"] = str(copy_to)
2547
+ if store is not DEFAULT:
2548
+ kwargs["store"] = store
2549
+ if meta is not DEFAULT:
2550
+ kwargs["meta"] = meta
2551
+ if properties is not DEFAULT:
2552
+ kwargs["properties"] = properties
2553
+ if ignore_above is not DEFAULT:
2554
+ kwargs["ignore_above"] = ignore_above
2555
+ if dynamic is not DEFAULT:
2556
+ kwargs["dynamic"] = dynamic
2557
+ if fields is not DEFAULT:
2558
+ kwargs["fields"] = fields
2559
+ if synthetic_source_keep is not DEFAULT:
2560
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2561
+ super().__init__(*args, **kwargs)
2562
+
2563
+
2564
+ class Join(Field):
2565
+ """
2566
+ :arg relations:
2567
+ :arg eager_global_ordinals:
2568
+ :arg meta: Metadata about the field.
2569
+ :arg properties:
2570
+ :arg ignore_above:
2571
+ :arg dynamic:
2572
+ :arg fields:
2573
+ :arg synthetic_source_keep:
2574
+ """
2575
+
2576
+ name = "join"
2577
+ _param_defs = {
2578
+ "properties": {"type": "field", "hash": True},
2579
+ "fields": {"type": "field", "hash": True},
2580
+ }
2581
+
2582
+ def __init__(
2583
+ self,
2584
+ *args: Any,
2585
+ relations: Union[
2586
+ Mapping[str, Union[str, Sequence[str]]], "DefaultType"
2587
+ ] = DEFAULT,
2588
+ eager_global_ordinals: Union[bool, "DefaultType"] = DEFAULT,
2589
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2590
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2591
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2592
+ dynamic: Union[
2593
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2594
+ ] = DEFAULT,
2595
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2596
+ synthetic_source_keep: Union[
2597
+ Literal["none", "arrays", "all"], "DefaultType"
2598
+ ] = DEFAULT,
2599
+ **kwargs: Any,
2600
+ ):
2601
+ if relations is not DEFAULT:
2602
+ kwargs["relations"] = relations
2603
+ if eager_global_ordinals is not DEFAULT:
2604
+ kwargs["eager_global_ordinals"] = eager_global_ordinals
2605
+ if meta is not DEFAULT:
2606
+ kwargs["meta"] = meta
2607
+ if properties is not DEFAULT:
2608
+ kwargs["properties"] = properties
2609
+ if ignore_above is not DEFAULT:
2610
+ kwargs["ignore_above"] = ignore_above
2611
+ if dynamic is not DEFAULT:
2612
+ kwargs["dynamic"] = dynamic
2613
+ if fields is not DEFAULT:
2614
+ kwargs["fields"] = fields
2615
+ if synthetic_source_keep is not DEFAULT:
2616
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2617
+ super().__init__(*args, **kwargs)
2618
+
2619
+
2620
+ class Keyword(Field):
2621
+ """
2622
+ :arg boost:
2623
+ :arg eager_global_ordinals:
2624
+ :arg index:
2625
+ :arg index_options:
2626
+ :arg script:
2627
+ :arg on_script_error:
2628
+ :arg normalizer:
2629
+ :arg norms:
2630
+ :arg null_value:
2631
+ :arg similarity:
2632
+ :arg split_queries_on_whitespace:
2633
+ :arg time_series_dimension: For internal use by Elastic only. Marks
2634
+ the field as a time series dimension. Defaults to false.
2635
+ :arg doc_values:
2636
+ :arg copy_to:
2637
+ :arg store:
2638
+ :arg meta: Metadata about the field.
2639
+ :arg properties:
2640
+ :arg ignore_above:
2641
+ :arg dynamic:
2642
+ :arg fields:
2643
+ :arg synthetic_source_keep:
2644
+ """
2645
+
2646
+ name = "keyword"
2647
+ _param_defs = {
2648
+ "normalizer": {"type": "normalizer"},
2649
+ "properties": {"type": "field", "hash": True},
2650
+ "fields": {"type": "field", "hash": True},
2651
+ }
2652
+
2653
+ def __init__(
2654
+ self,
2655
+ *args: Any,
2656
+ boost: Union[float, "DefaultType"] = DEFAULT,
2657
+ eager_global_ordinals: Union[bool, "DefaultType"] = DEFAULT,
2658
+ index: Union[bool, "DefaultType"] = DEFAULT,
2659
+ index_options: Union[
2660
+ Literal["docs", "freqs", "positions", "offsets"], "DefaultType"
2661
+ ] = DEFAULT,
2662
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
2663
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
2664
+ normalizer: Union[str, DslBase, "DefaultType"] = DEFAULT,
2665
+ norms: Union[bool, "DefaultType"] = DEFAULT,
2666
+ null_value: Union[str, "DefaultType"] = DEFAULT,
2667
+ similarity: Union[str, None, "DefaultType"] = DEFAULT,
2668
+ split_queries_on_whitespace: Union[bool, "DefaultType"] = DEFAULT,
2669
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
2670
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
2671
+ copy_to: Union[
2672
+ Union[str, "InstrumentedField"],
2673
+ Sequence[Union[str, "InstrumentedField"]],
2674
+ "DefaultType",
2675
+ ] = DEFAULT,
2676
+ store: Union[bool, "DefaultType"] = DEFAULT,
2677
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2678
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2679
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2680
+ dynamic: Union[
2681
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2682
+ ] = DEFAULT,
2683
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2684
+ synthetic_source_keep: Union[
2685
+ Literal["none", "arrays", "all"], "DefaultType"
2686
+ ] = DEFAULT,
2687
+ **kwargs: Any,
2688
+ ):
2689
+ if boost is not DEFAULT:
2690
+ kwargs["boost"] = boost
2691
+ if eager_global_ordinals is not DEFAULT:
2692
+ kwargs["eager_global_ordinals"] = eager_global_ordinals
2693
+ if index is not DEFAULT:
2694
+ kwargs["index"] = index
2695
+ if index_options is not DEFAULT:
2696
+ kwargs["index_options"] = index_options
2697
+ if script is not DEFAULT:
2698
+ kwargs["script"] = script
2699
+ if on_script_error is not DEFAULT:
2700
+ kwargs["on_script_error"] = on_script_error
2701
+ if normalizer is not DEFAULT:
2702
+ kwargs["normalizer"] = normalizer
2703
+ if norms is not DEFAULT:
2704
+ kwargs["norms"] = norms
2705
+ if null_value is not DEFAULT:
2706
+ kwargs["null_value"] = null_value
2707
+ if similarity is not DEFAULT:
2708
+ kwargs["similarity"] = similarity
2709
+ if split_queries_on_whitespace is not DEFAULT:
2710
+ kwargs["split_queries_on_whitespace"] = split_queries_on_whitespace
2711
+ if time_series_dimension is not DEFAULT:
2712
+ kwargs["time_series_dimension"] = time_series_dimension
2713
+ if doc_values is not DEFAULT:
2714
+ kwargs["doc_values"] = doc_values
2715
+ if copy_to is not DEFAULT:
2716
+ kwargs["copy_to"] = str(copy_to)
2717
+ if store is not DEFAULT:
2718
+ kwargs["store"] = store
2719
+ if meta is not DEFAULT:
2720
+ kwargs["meta"] = meta
2721
+ if properties is not DEFAULT:
2722
+ kwargs["properties"] = properties
2723
+ if ignore_above is not DEFAULT:
2724
+ kwargs["ignore_above"] = ignore_above
2725
+ if dynamic is not DEFAULT:
2726
+ kwargs["dynamic"] = dynamic
2727
+ if fields is not DEFAULT:
2728
+ kwargs["fields"] = fields
2729
+ if synthetic_source_keep is not DEFAULT:
2730
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2731
+ super().__init__(*args, **kwargs)
2732
+
2733
+
2734
+ class Long(Integer):
2735
+ """
2736
+ :arg null_value:
2737
+ :arg boost:
2738
+ :arg coerce:
2739
+ :arg ignore_malformed:
2740
+ :arg index:
2741
+ :arg on_script_error:
2742
+ :arg script:
2743
+ :arg time_series_metric: For internal use by Elastic only. Marks the
2744
+ field as a time series dimension. Defaults to false.
2745
+ :arg time_series_dimension: For internal use by Elastic only. Marks
2746
+ the field as a time series dimension. Defaults to false.
2747
+ :arg doc_values:
2748
+ :arg copy_to:
2749
+ :arg store:
2750
+ :arg meta: Metadata about the field.
2751
+ :arg properties:
2752
+ :arg ignore_above:
2753
+ :arg dynamic:
2754
+ :arg fields:
2755
+ :arg synthetic_source_keep:
2756
+ """
2757
+
2758
+ name = "long"
2759
+ _param_defs = {
2760
+ "properties": {"type": "field", "hash": True},
2761
+ "fields": {"type": "field", "hash": True},
2762
+ }
2763
+
2764
+ def __init__(
2765
+ self,
2766
+ *args: Any,
2767
+ null_value: Union[int, "DefaultType"] = DEFAULT,
2768
+ boost: Union[float, "DefaultType"] = DEFAULT,
2769
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
2770
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
2771
+ index: Union[bool, "DefaultType"] = DEFAULT,
2772
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
2773
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
2774
+ time_series_metric: Union[
2775
+ Literal["gauge", "counter", "summary", "histogram", "position"],
2776
+ "DefaultType",
2777
+ ] = DEFAULT,
2778
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
2779
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
2780
+ copy_to: Union[
2781
+ Union[str, "InstrumentedField"],
2782
+ Sequence[Union[str, "InstrumentedField"]],
2783
+ "DefaultType",
2784
+ ] = DEFAULT,
2785
+ store: Union[bool, "DefaultType"] = DEFAULT,
2786
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2787
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2788
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2789
+ dynamic: Union[
2790
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2791
+ ] = DEFAULT,
2792
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2793
+ synthetic_source_keep: Union[
2794
+ Literal["none", "arrays", "all"], "DefaultType"
2795
+ ] = DEFAULT,
2796
+ **kwargs: Any,
2797
+ ):
2798
+ if null_value is not DEFAULT:
2799
+ kwargs["null_value"] = null_value
2800
+ if boost is not DEFAULT:
2801
+ kwargs["boost"] = boost
2802
+ if coerce is not DEFAULT:
2803
+ kwargs["coerce"] = coerce
2804
+ if ignore_malformed is not DEFAULT:
2805
+ kwargs["ignore_malformed"] = ignore_malformed
2806
+ if index is not DEFAULT:
2807
+ kwargs["index"] = index
2808
+ if on_script_error is not DEFAULT:
2809
+ kwargs["on_script_error"] = on_script_error
2810
+ if script is not DEFAULT:
2811
+ kwargs["script"] = script
2812
+ if time_series_metric is not DEFAULT:
2813
+ kwargs["time_series_metric"] = time_series_metric
2814
+ if time_series_dimension is not DEFAULT:
2815
+ kwargs["time_series_dimension"] = time_series_dimension
2816
+ if doc_values is not DEFAULT:
2817
+ kwargs["doc_values"] = doc_values
2818
+ if copy_to is not DEFAULT:
2819
+ kwargs["copy_to"] = str(copy_to)
2820
+ if store is not DEFAULT:
2821
+ kwargs["store"] = store
2822
+ if meta is not DEFAULT:
2823
+ kwargs["meta"] = meta
2824
+ if properties is not DEFAULT:
2825
+ kwargs["properties"] = properties
2826
+ if ignore_above is not DEFAULT:
2827
+ kwargs["ignore_above"] = ignore_above
2828
+ if dynamic is not DEFAULT:
2829
+ kwargs["dynamic"] = dynamic
2830
+ if fields is not DEFAULT:
2831
+ kwargs["fields"] = fields
2832
+ if synthetic_source_keep is not DEFAULT:
2833
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2834
+ super().__init__(*args, **kwargs)
2835
+
2836
+
2837
+ class LongRange(RangeField):
2838
+ """
2839
+ :arg boost:
2840
+ :arg coerce:
2841
+ :arg index:
2842
+ :arg doc_values:
2843
+ :arg copy_to:
2844
+ :arg store:
2845
+ :arg meta: Metadata about the field.
2846
+ :arg properties:
2847
+ :arg ignore_above:
2848
+ :arg dynamic:
2849
+ :arg fields:
2850
+ :arg synthetic_source_keep:
2851
+ """
2852
+
2853
+ name = "long_range"
2854
+ _core_field = Long()
2855
+ _param_defs = {
2856
+ "properties": {"type": "field", "hash": True},
2857
+ "fields": {"type": "field", "hash": True},
2858
+ }
2859
+
2860
+ def __init__(
2861
+ self,
2862
+ *args: Any,
2863
+ boost: Union[float, "DefaultType"] = DEFAULT,
2864
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
2865
+ index: Union[bool, "DefaultType"] = DEFAULT,
2866
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
2867
+ copy_to: Union[
2868
+ Union[str, "InstrumentedField"],
2869
+ Sequence[Union[str, "InstrumentedField"]],
2870
+ "DefaultType",
2871
+ ] = DEFAULT,
2872
+ store: Union[bool, "DefaultType"] = DEFAULT,
2873
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2874
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2875
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2876
+ dynamic: Union[
2877
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2878
+ ] = DEFAULT,
2879
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2880
+ synthetic_source_keep: Union[
2881
+ Literal["none", "arrays", "all"], "DefaultType"
2882
+ ] = DEFAULT,
2883
+ **kwargs: Any,
2884
+ ):
2885
+ if boost is not DEFAULT:
2886
+ kwargs["boost"] = boost
2887
+ if coerce is not DEFAULT:
2888
+ kwargs["coerce"] = coerce
2889
+ if index is not DEFAULT:
2890
+ kwargs["index"] = index
2891
+ if doc_values is not DEFAULT:
2892
+ kwargs["doc_values"] = doc_values
2893
+ if copy_to is not DEFAULT:
2894
+ kwargs["copy_to"] = str(copy_to)
2895
+ if store is not DEFAULT:
2896
+ kwargs["store"] = store
2897
+ if meta is not DEFAULT:
2898
+ kwargs["meta"] = meta
2899
+ if properties is not DEFAULT:
2900
+ kwargs["properties"] = properties
2901
+ if ignore_above is not DEFAULT:
2902
+ kwargs["ignore_above"] = ignore_above
2903
+ if dynamic is not DEFAULT:
2904
+ kwargs["dynamic"] = dynamic
2905
+ if fields is not DEFAULT:
2906
+ kwargs["fields"] = fields
2907
+ if synthetic_source_keep is not DEFAULT:
2908
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
2909
+ super().__init__(*args, **kwargs)
2910
+
2911
+
2912
+ class MatchOnlyText(Field):
2913
+ """
2914
+ A variant of text that trades scoring and efficiency of positional
2915
+ queries for space efficiency. This field effectively stores data the
2916
+ same way as a text field that only indexes documents (index_options:
2917
+ docs) and disables norms (norms: false). Term queries perform as fast
2918
+ if not faster as on text fields, however queries that need positions
2919
+ such as the match_phrase query perform slower as they need to look at
2920
+ the _source document to verify whether a phrase matches. All queries
2921
+ return constant scores that are equal to 1.0.
2922
+
2923
+ :arg fields:
2924
+ :arg meta: Metadata about the field.
2925
+ :arg copy_to: Allows you to copy the values of multiple fields into a
2926
+ group field, which can then be queried as a single field.
2927
+ """
2928
+
2929
+ name = "match_only_text"
2930
+ _param_defs = {
2931
+ "fields": {"type": "field", "hash": True},
2932
+ }
2933
+
2934
+ def __init__(
2935
+ self,
2936
+ *args: Any,
2937
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2938
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2939
+ copy_to: Union[
2940
+ Union[str, "InstrumentedField"],
2941
+ Sequence[Union[str, "InstrumentedField"]],
2942
+ "DefaultType",
2943
+ ] = DEFAULT,
2944
+ **kwargs: Any,
2945
+ ):
2946
+ if fields is not DEFAULT:
2947
+ kwargs["fields"] = fields
2948
+ if meta is not DEFAULT:
2949
+ kwargs["meta"] = meta
2950
+ if copy_to is not DEFAULT:
2951
+ kwargs["copy_to"] = str(copy_to)
2952
+ super().__init__(*args, **kwargs)
2953
+
2954
+
2955
+ class Murmur3(Field):
2956
+ """
2957
+ :arg doc_values:
2958
+ :arg copy_to:
2959
+ :arg store:
2960
+ :arg meta: Metadata about the field.
2961
+ :arg properties:
2962
+ :arg ignore_above:
2963
+ :arg dynamic:
2964
+ :arg fields:
2965
+ :arg synthetic_source_keep:
2966
+ """
2967
+
2968
+ name = "murmur3"
2969
+ _param_defs = {
2970
+ "properties": {"type": "field", "hash": True},
2971
+ "fields": {"type": "field", "hash": True},
2972
+ }
2973
+
2974
+ def __init__(
2975
+ self,
2976
+ *args: Any,
2977
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
2978
+ copy_to: Union[
2979
+ Union[str, "InstrumentedField"],
2980
+ Sequence[Union[str, "InstrumentedField"]],
2981
+ "DefaultType",
2982
+ ] = DEFAULT,
2983
+ store: Union[bool, "DefaultType"] = DEFAULT,
2984
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
2985
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2986
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
2987
+ dynamic: Union[
2988
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
2989
+ ] = DEFAULT,
2990
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
2991
+ synthetic_source_keep: Union[
2992
+ Literal["none", "arrays", "all"], "DefaultType"
2993
+ ] = DEFAULT,
2994
+ **kwargs: Any,
2995
+ ):
2996
+ if doc_values is not DEFAULT:
2997
+ kwargs["doc_values"] = doc_values
2998
+ if copy_to is not DEFAULT:
2999
+ kwargs["copy_to"] = str(copy_to)
3000
+ if store is not DEFAULT:
3001
+ kwargs["store"] = store
3002
+ if meta is not DEFAULT:
3003
+ kwargs["meta"] = meta
3004
+ if properties is not DEFAULT:
3005
+ kwargs["properties"] = properties
3006
+ if ignore_above is not DEFAULT:
3007
+ kwargs["ignore_above"] = ignore_above
3008
+ if dynamic is not DEFAULT:
3009
+ kwargs["dynamic"] = dynamic
3010
+ if fields is not DEFAULT:
3011
+ kwargs["fields"] = fields
3012
+ if synthetic_source_keep is not DEFAULT:
3013
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3014
+ super().__init__(*args, **kwargs)
3015
+
3016
+
3017
+ class Nested(Object):
3018
+ """
3019
+ :arg enabled:
3020
+ :arg include_in_parent:
3021
+ :arg include_in_root:
3022
+ :arg copy_to:
3023
+ :arg store:
3024
+ :arg meta: Metadata about the field.
3025
+ :arg properties:
3026
+ :arg ignore_above:
3027
+ :arg dynamic:
3028
+ :arg fields:
3029
+ :arg synthetic_source_keep:
3030
+ """
3031
+
3032
+ name = "nested"
3033
+ _param_defs = {
3034
+ "properties": {"type": "field", "hash": True},
3035
+ "fields": {"type": "field", "hash": True},
3036
+ }
3037
+
3038
+ def __init__(
3039
+ self,
3040
+ *args: Any,
3041
+ enabled: Union[bool, "DefaultType"] = DEFAULT,
3042
+ include_in_parent: Union[bool, "DefaultType"] = DEFAULT,
3043
+ include_in_root: Union[bool, "DefaultType"] = DEFAULT,
3044
+ copy_to: Union[
3045
+ Union[str, "InstrumentedField"],
3046
+ Sequence[Union[str, "InstrumentedField"]],
3047
+ "DefaultType",
3048
+ ] = DEFAULT,
3049
+ store: Union[bool, "DefaultType"] = DEFAULT,
3050
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3051
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3052
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3053
+ dynamic: Union[
3054
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3055
+ ] = DEFAULT,
3056
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3057
+ synthetic_source_keep: Union[
3058
+ Literal["none", "arrays", "all"], "DefaultType"
3059
+ ] = DEFAULT,
3060
+ **kwargs: Any,
3061
+ ):
3062
+ if enabled is not DEFAULT:
3063
+ kwargs["enabled"] = enabled
3064
+ if include_in_parent is not DEFAULT:
3065
+ kwargs["include_in_parent"] = include_in_parent
3066
+ if include_in_root is not DEFAULT:
3067
+ kwargs["include_in_root"] = include_in_root
3068
+ if copy_to is not DEFAULT:
3069
+ kwargs["copy_to"] = str(copy_to)
3070
+ if store is not DEFAULT:
3071
+ kwargs["store"] = store
3072
+ if meta is not DEFAULT:
3073
+ kwargs["meta"] = meta
3074
+ if properties is not DEFAULT:
3075
+ kwargs["properties"] = properties
3076
+ if ignore_above is not DEFAULT:
3077
+ kwargs["ignore_above"] = ignore_above
3078
+ if dynamic is not DEFAULT:
3079
+ kwargs["dynamic"] = dynamic
3080
+ if fields is not DEFAULT:
3081
+ kwargs["fields"] = fields
3082
+ if synthetic_source_keep is not DEFAULT:
3083
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3084
+ kwargs.setdefault("multi", True)
3085
+ super().__init__(*args, **kwargs)
3086
+
3087
+
3088
+ class Percolator(Field):
3089
+ """
3090
+ :arg meta: Metadata about the field.
3091
+ :arg properties:
3092
+ :arg ignore_above:
3093
+ :arg dynamic:
3094
+ :arg fields:
3095
+ :arg synthetic_source_keep:
3096
+ """
3097
+
3098
+ name = "percolator"
3099
+ _coerce = True
3100
+ _param_defs = {
3101
+ "properties": {"type": "field", "hash": True},
3102
+ "fields": {"type": "field", "hash": True},
3103
+ }
3104
+
3105
+ def __init__(
3106
+ self,
3107
+ *args: Any,
3108
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3109
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3110
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3111
+ dynamic: Union[
3112
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3113
+ ] = DEFAULT,
3114
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3115
+ synthetic_source_keep: Union[
3116
+ Literal["none", "arrays", "all"], "DefaultType"
3117
+ ] = DEFAULT,
3118
+ **kwargs: Any,
3119
+ ):
3120
+ if meta is not DEFAULT:
3121
+ kwargs["meta"] = meta
3122
+ if properties is not DEFAULT:
3123
+ kwargs["properties"] = properties
3124
+ if ignore_above is not DEFAULT:
3125
+ kwargs["ignore_above"] = ignore_above
3126
+ if dynamic is not DEFAULT:
3127
+ kwargs["dynamic"] = dynamic
3128
+ if fields is not DEFAULT:
3129
+ kwargs["fields"] = fields
3130
+ if synthetic_source_keep is not DEFAULT:
3131
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3132
+ super().__init__(*args, **kwargs)
3133
+
3134
+ def _deserialize(self, data: Any) -> "Query":
3135
+ return Q(data) # type: ignore[no-any-return]
3136
+
3137
+ def _serialize(self, data: Any) -> Optional[Dict[str, Any]]:
3138
+ if data is None:
3139
+ return None
3140
+ return data.to_dict() # type: ignore[no-any-return]
3141
+
3142
+
3143
+ class Point(Field):
3144
+ """
3145
+ :arg ignore_malformed:
3146
+ :arg ignore_z_value:
3147
+ :arg null_value:
3148
+ :arg doc_values:
3149
+ :arg copy_to:
3150
+ :arg store:
3151
+ :arg meta: Metadata about the field.
3152
+ :arg properties:
3153
+ :arg ignore_above:
3154
+ :arg dynamic:
3155
+ :arg fields:
3156
+ :arg synthetic_source_keep:
3157
+ """
3158
+
3159
+ name = "point"
3160
+ _param_defs = {
3161
+ "properties": {"type": "field", "hash": True},
3162
+ "fields": {"type": "field", "hash": True},
3163
+ }
3164
+
3165
+ def __init__(
3166
+ self,
3167
+ *args: Any,
3168
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
3169
+ ignore_z_value: Union[bool, "DefaultType"] = DEFAULT,
3170
+ null_value: Union[str, "DefaultType"] = DEFAULT,
3171
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
3172
+ copy_to: Union[
3173
+ Union[str, "InstrumentedField"],
3174
+ Sequence[Union[str, "InstrumentedField"]],
3175
+ "DefaultType",
3176
+ ] = DEFAULT,
3177
+ store: Union[bool, "DefaultType"] = DEFAULT,
3178
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3179
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3180
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3181
+ dynamic: Union[
3182
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3183
+ ] = DEFAULT,
3184
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3185
+ synthetic_source_keep: Union[
3186
+ Literal["none", "arrays", "all"], "DefaultType"
3187
+ ] = DEFAULT,
3188
+ **kwargs: Any,
3189
+ ):
3190
+ if ignore_malformed is not DEFAULT:
3191
+ kwargs["ignore_malformed"] = ignore_malformed
3192
+ if ignore_z_value is not DEFAULT:
3193
+ kwargs["ignore_z_value"] = ignore_z_value
3194
+ if null_value is not DEFAULT:
3195
+ kwargs["null_value"] = null_value
3196
+ if doc_values is not DEFAULT:
3197
+ kwargs["doc_values"] = doc_values
3198
+ if copy_to is not DEFAULT:
3199
+ kwargs["copy_to"] = str(copy_to)
3200
+ if store is not DEFAULT:
3201
+ kwargs["store"] = store
3202
+ if meta is not DEFAULT:
3203
+ kwargs["meta"] = meta
3204
+ if properties is not DEFAULT:
3205
+ kwargs["properties"] = properties
3206
+ if ignore_above is not DEFAULT:
3207
+ kwargs["ignore_above"] = ignore_above
3208
+ if dynamic is not DEFAULT:
3209
+ kwargs["dynamic"] = dynamic
3210
+ if fields is not DEFAULT:
3211
+ kwargs["fields"] = fields
3212
+ if synthetic_source_keep is not DEFAULT:
3213
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3214
+ super().__init__(*args, **kwargs)
3215
+
3216
+
3217
+ class RankFeature(Float):
3218
+ """
3219
+ :arg positive_score_impact:
3220
+ :arg meta: Metadata about the field.
3221
+ :arg properties:
3222
+ :arg ignore_above:
3223
+ :arg dynamic:
3224
+ :arg fields:
3225
+ :arg synthetic_source_keep:
3226
+ """
3227
+
3228
+ name = "rank_feature"
3229
+ _param_defs = {
3230
+ "properties": {"type": "field", "hash": True},
3231
+ "fields": {"type": "field", "hash": True},
3232
+ }
3233
+
3234
+ def __init__(
3235
+ self,
3236
+ *args: Any,
3237
+ positive_score_impact: Union[bool, "DefaultType"] = DEFAULT,
3238
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3239
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3240
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3241
+ dynamic: Union[
3242
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3243
+ ] = DEFAULT,
3244
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3245
+ synthetic_source_keep: Union[
3246
+ Literal["none", "arrays", "all"], "DefaultType"
3247
+ ] = DEFAULT,
3248
+ **kwargs: Any,
3249
+ ):
3250
+ if positive_score_impact is not DEFAULT:
3251
+ kwargs["positive_score_impact"] = positive_score_impact
3252
+ if meta is not DEFAULT:
3253
+ kwargs["meta"] = meta
3254
+ if properties is not DEFAULT:
3255
+ kwargs["properties"] = properties
3256
+ if ignore_above is not DEFAULT:
3257
+ kwargs["ignore_above"] = ignore_above
3258
+ if dynamic is not DEFAULT:
3259
+ kwargs["dynamic"] = dynamic
3260
+ if fields is not DEFAULT:
3261
+ kwargs["fields"] = fields
3262
+ if synthetic_source_keep is not DEFAULT:
3263
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3264
+ super().__init__(*args, **kwargs)
3265
+
3266
+
3267
+ class RankFeatures(Field):
3268
+ """
3269
+ :arg positive_score_impact:
3270
+ :arg meta: Metadata about the field.
3271
+ :arg properties:
3272
+ :arg ignore_above:
3273
+ :arg dynamic:
3274
+ :arg fields:
3275
+ :arg synthetic_source_keep:
3276
+ """
3277
+
3278
+ name = "rank_features"
3279
+ _param_defs = {
3280
+ "properties": {"type": "field", "hash": True},
3281
+ "fields": {"type": "field", "hash": True},
3282
+ }
3283
+
3284
+ def __init__(
3285
+ self,
3286
+ *args: Any,
3287
+ positive_score_impact: Union[bool, "DefaultType"] = DEFAULT,
3288
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3289
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3290
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3291
+ dynamic: Union[
3292
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3293
+ ] = DEFAULT,
3294
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3295
+ synthetic_source_keep: Union[
3296
+ Literal["none", "arrays", "all"], "DefaultType"
3297
+ ] = DEFAULT,
3298
+ **kwargs: Any,
3299
+ ):
3300
+ if positive_score_impact is not DEFAULT:
3301
+ kwargs["positive_score_impact"] = positive_score_impact
3302
+ if meta is not DEFAULT:
3303
+ kwargs["meta"] = meta
3304
+ if properties is not DEFAULT:
3305
+ kwargs["properties"] = properties
3306
+ if ignore_above is not DEFAULT:
3307
+ kwargs["ignore_above"] = ignore_above
3308
+ if dynamic is not DEFAULT:
3309
+ kwargs["dynamic"] = dynamic
3310
+ if fields is not DEFAULT:
3311
+ kwargs["fields"] = fields
3312
+ if synthetic_source_keep is not DEFAULT:
3313
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3314
+ super().__init__(*args, **kwargs)
3315
+
3316
+
3317
+ class ScaledFloat(Float):
3318
+ """
3319
+ :arg null_value:
3320
+ :arg scaling_factor:
3321
+ :arg boost:
3322
+ :arg coerce:
3323
+ :arg ignore_malformed:
3324
+ :arg index:
3325
+ :arg on_script_error:
3326
+ :arg script:
3327
+ :arg time_series_metric: For internal use by Elastic only. Marks the
3328
+ field as a time series dimension. Defaults to false.
3329
+ :arg time_series_dimension: For internal use by Elastic only. Marks
3330
+ the field as a time series dimension. Defaults to false.
3331
+ :arg doc_values:
3332
+ :arg copy_to:
3333
+ :arg store:
3334
+ :arg meta: Metadata about the field.
3335
+ :arg properties:
3336
+ :arg ignore_above:
3337
+ :arg dynamic:
3338
+ :arg fields:
3339
+ :arg synthetic_source_keep:
3340
+ """
3341
+
3342
+ name = "scaled_float"
3343
+ _param_defs = {
3344
+ "properties": {"type": "field", "hash": True},
3345
+ "fields": {"type": "field", "hash": True},
3346
+ }
3347
+
3348
+ def __init__(
3349
+ self,
3350
+ *args: Any,
3351
+ null_value: Union[float, "DefaultType"] = DEFAULT,
3352
+ scaling_factor: Union[float, "DefaultType"] = DEFAULT,
3353
+ boost: Union[float, "DefaultType"] = DEFAULT,
3354
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
3355
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
3356
+ index: Union[bool, "DefaultType"] = DEFAULT,
3357
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
3358
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
3359
+ time_series_metric: Union[
3360
+ Literal["gauge", "counter", "summary", "histogram", "position"],
3361
+ "DefaultType",
3362
+ ] = DEFAULT,
3363
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
3364
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
3365
+ copy_to: Union[
3366
+ Union[str, "InstrumentedField"],
3367
+ Sequence[Union[str, "InstrumentedField"]],
3368
+ "DefaultType",
3369
+ ] = DEFAULT,
3370
+ store: Union[bool, "DefaultType"] = DEFAULT,
3371
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3372
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3373
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3374
+ dynamic: Union[
3375
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3376
+ ] = DEFAULT,
3377
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3378
+ synthetic_source_keep: Union[
3379
+ Literal["none", "arrays", "all"], "DefaultType"
3380
+ ] = DEFAULT,
3381
+ **kwargs: Any,
3382
+ ):
3383
+ if null_value is not DEFAULT:
3384
+ kwargs["null_value"] = null_value
3385
+ if scaling_factor is not DEFAULT:
3386
+ kwargs["scaling_factor"] = scaling_factor
3387
+ if boost is not DEFAULT:
3388
+ kwargs["boost"] = boost
3389
+ if coerce is not DEFAULT:
3390
+ kwargs["coerce"] = coerce
3391
+ if ignore_malformed is not DEFAULT:
3392
+ kwargs["ignore_malformed"] = ignore_malformed
3393
+ if index is not DEFAULT:
3394
+ kwargs["index"] = index
3395
+ if on_script_error is not DEFAULT:
3396
+ kwargs["on_script_error"] = on_script_error
3397
+ if script is not DEFAULT:
3398
+ kwargs["script"] = script
3399
+ if time_series_metric is not DEFAULT:
3400
+ kwargs["time_series_metric"] = time_series_metric
3401
+ if time_series_dimension is not DEFAULT:
3402
+ kwargs["time_series_dimension"] = time_series_dimension
3403
+ if doc_values is not DEFAULT:
3404
+ kwargs["doc_values"] = doc_values
3405
+ if copy_to is not DEFAULT:
3406
+ kwargs["copy_to"] = str(copy_to)
3407
+ if store is not DEFAULT:
3408
+ kwargs["store"] = store
3409
+ if meta is not DEFAULT:
3410
+ kwargs["meta"] = meta
3411
+ if properties is not DEFAULT:
3412
+ kwargs["properties"] = properties
3413
+ if ignore_above is not DEFAULT:
3414
+ kwargs["ignore_above"] = ignore_above
3415
+ if dynamic is not DEFAULT:
3416
+ kwargs["dynamic"] = dynamic
3417
+ if fields is not DEFAULT:
3418
+ kwargs["fields"] = fields
3419
+ if synthetic_source_keep is not DEFAULT:
3420
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3421
+ if "scaling_factor" not in kwargs:
3422
+ if len(args) > 0:
3423
+ kwargs["scaling_factor"] = args[0]
3424
+ args = args[1:]
3425
+ else:
3426
+ raise TypeError("missing required argument: 'scaling_factor'")
3427
+ super().__init__(*args, **kwargs)
3428
+
3429
+
3430
+ class SearchAsYouType(Field):
3431
+ """
3432
+ :arg analyzer:
3433
+ :arg index:
3434
+ :arg index_options:
3435
+ :arg max_shingle_size:
3436
+ :arg norms:
3437
+ :arg search_analyzer:
3438
+ :arg search_quote_analyzer:
3439
+ :arg similarity:
3440
+ :arg term_vector:
3441
+ :arg copy_to:
3442
+ :arg store:
3443
+ :arg meta: Metadata about the field.
3444
+ :arg properties:
3445
+ :arg ignore_above:
3446
+ :arg dynamic:
3447
+ :arg fields:
3448
+ :arg synthetic_source_keep:
3449
+ """
3450
+
3451
+ name = "search_as_you_type"
3452
+ _param_defs = {
3453
+ "analyzer": {"type": "analyzer"},
3454
+ "search_analyzer": {"type": "analyzer"},
3455
+ "search_quote_analyzer": {"type": "analyzer"},
3456
+ "properties": {"type": "field", "hash": True},
3457
+ "fields": {"type": "field", "hash": True},
3458
+ }
3459
+
3460
+ def __init__(
3461
+ self,
3462
+ *args: Any,
3463
+ analyzer: Union[str, DslBase, "DefaultType"] = DEFAULT,
3464
+ index: Union[bool, "DefaultType"] = DEFAULT,
3465
+ index_options: Union[
3466
+ Literal["docs", "freqs", "positions", "offsets"], "DefaultType"
3467
+ ] = DEFAULT,
3468
+ max_shingle_size: Union[int, "DefaultType"] = DEFAULT,
3469
+ norms: Union[bool, "DefaultType"] = DEFAULT,
3470
+ search_analyzer: Union[str, DslBase, "DefaultType"] = DEFAULT,
3471
+ search_quote_analyzer: Union[str, DslBase, "DefaultType"] = DEFAULT,
3472
+ similarity: Union[str, None, "DefaultType"] = DEFAULT,
3473
+ term_vector: Union[
3474
+ Literal[
3475
+ "no",
3476
+ "yes",
3477
+ "with_offsets",
3478
+ "with_positions",
3479
+ "with_positions_offsets",
3480
+ "with_positions_offsets_payloads",
3481
+ "with_positions_payloads",
3482
+ ],
3483
+ "DefaultType",
3484
+ ] = DEFAULT,
3485
+ copy_to: Union[
3486
+ Union[str, "InstrumentedField"],
3487
+ Sequence[Union[str, "InstrumentedField"]],
3488
+ "DefaultType",
3489
+ ] = DEFAULT,
3490
+ store: Union[bool, "DefaultType"] = DEFAULT,
3491
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3492
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3493
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3494
+ dynamic: Union[
3495
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3496
+ ] = DEFAULT,
3497
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3498
+ synthetic_source_keep: Union[
3499
+ Literal["none", "arrays", "all"], "DefaultType"
3500
+ ] = DEFAULT,
3501
+ **kwargs: Any,
3502
+ ):
3503
+ if analyzer is not DEFAULT:
3504
+ kwargs["analyzer"] = analyzer
3505
+ if index is not DEFAULT:
3506
+ kwargs["index"] = index
3507
+ if index_options is not DEFAULT:
3508
+ kwargs["index_options"] = index_options
3509
+ if max_shingle_size is not DEFAULT:
3510
+ kwargs["max_shingle_size"] = max_shingle_size
3511
+ if norms is not DEFAULT:
3512
+ kwargs["norms"] = norms
3513
+ if search_analyzer is not DEFAULT:
3514
+ kwargs["search_analyzer"] = search_analyzer
3515
+ if search_quote_analyzer is not DEFAULT:
3516
+ kwargs["search_quote_analyzer"] = search_quote_analyzer
3517
+ if similarity is not DEFAULT:
3518
+ kwargs["similarity"] = similarity
3519
+ if term_vector is not DEFAULT:
3520
+ kwargs["term_vector"] = term_vector
3521
+ if copy_to is not DEFAULT:
3522
+ kwargs["copy_to"] = str(copy_to)
3523
+ if store is not DEFAULT:
3524
+ kwargs["store"] = store
3525
+ if meta is not DEFAULT:
3526
+ kwargs["meta"] = meta
3527
+ if properties is not DEFAULT:
3528
+ kwargs["properties"] = properties
3529
+ if ignore_above is not DEFAULT:
3530
+ kwargs["ignore_above"] = ignore_above
3531
+ if dynamic is not DEFAULT:
3532
+ kwargs["dynamic"] = dynamic
3533
+ if fields is not DEFAULT:
3534
+ kwargs["fields"] = fields
3535
+ if synthetic_source_keep is not DEFAULT:
3536
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3537
+ super().__init__(*args, **kwargs)
3538
+
3539
+
3540
+ class SemanticText(Field):
3541
+ """
3542
+ :arg meta:
3543
+ :arg inference_id: Inference endpoint that will be used to generate
3544
+ embeddings for the field. This parameter cannot be updated. Use
3545
+ the Create inference API to create the endpoint. If
3546
+ `search_inference_id` is specified, the inference endpoint will
3547
+ only be used at index time. Defaults to `.elser-2-elasticsearch`
3548
+ if omitted.
3549
+ :arg search_inference_id: Inference endpoint that will be used to
3550
+ generate embeddings at query time. You can update this parameter
3551
+ by using the Update mapping API. Use the Create inference API to
3552
+ create the endpoint. If not specified, the inference endpoint
3553
+ defined by inference_id will be used at both index and query time.
3554
+ """
3555
+
3556
+ name = "semantic_text"
3557
+
3558
+ def __init__(
3559
+ self,
3560
+ *args: Any,
3561
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3562
+ inference_id: Union[str, "DefaultType"] = DEFAULT,
3563
+ search_inference_id: Union[str, "DefaultType"] = DEFAULT,
3564
+ **kwargs: Any,
3565
+ ):
3566
+ if meta is not DEFAULT:
3567
+ kwargs["meta"] = meta
3568
+ if inference_id is not DEFAULT:
3569
+ kwargs["inference_id"] = inference_id
3570
+ if search_inference_id is not DEFAULT:
3571
+ kwargs["search_inference_id"] = search_inference_id
3572
+ super().__init__(*args, **kwargs)
3573
+
3574
+
3575
+ class Shape(Field):
3576
+ """
3577
+ The `shape` data type facilitates the indexing of and searching with
3578
+ arbitrary `x, y` cartesian shapes such as rectangles and polygons.
3579
+
3580
+ :arg coerce:
3581
+ :arg ignore_malformed:
3582
+ :arg ignore_z_value:
3583
+ :arg orientation:
3584
+ :arg doc_values:
3585
+ :arg copy_to:
3586
+ :arg store:
3587
+ :arg meta: Metadata about the field.
3588
+ :arg properties:
3589
+ :arg ignore_above:
3590
+ :arg dynamic:
3591
+ :arg fields:
3592
+ :arg synthetic_source_keep:
3593
+ """
3594
+
3595
+ name = "shape"
3596
+ _param_defs = {
3597
+ "properties": {"type": "field", "hash": True},
3598
+ "fields": {"type": "field", "hash": True},
3599
+ }
3600
+
3601
+ def __init__(
3602
+ self,
3603
+ *args: Any,
3604
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
3605
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
3606
+ ignore_z_value: Union[bool, "DefaultType"] = DEFAULT,
3607
+ orientation: Union[Literal["right", "left"], "DefaultType"] = DEFAULT,
3608
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
3609
+ copy_to: Union[
3610
+ Union[str, "InstrumentedField"],
3611
+ Sequence[Union[str, "InstrumentedField"]],
3612
+ "DefaultType",
3613
+ ] = DEFAULT,
3614
+ store: Union[bool, "DefaultType"] = DEFAULT,
3615
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3616
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3617
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3618
+ dynamic: Union[
3619
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3620
+ ] = DEFAULT,
3621
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3622
+ synthetic_source_keep: Union[
3623
+ Literal["none", "arrays", "all"], "DefaultType"
3624
+ ] = DEFAULT,
3625
+ **kwargs: Any,
3626
+ ):
3627
+ if coerce is not DEFAULT:
3628
+ kwargs["coerce"] = coerce
3629
+ if ignore_malformed is not DEFAULT:
3630
+ kwargs["ignore_malformed"] = ignore_malformed
3631
+ if ignore_z_value is not DEFAULT:
3632
+ kwargs["ignore_z_value"] = ignore_z_value
3633
+ if orientation is not DEFAULT:
3634
+ kwargs["orientation"] = orientation
3635
+ if doc_values is not DEFAULT:
3636
+ kwargs["doc_values"] = doc_values
3637
+ if copy_to is not DEFAULT:
3638
+ kwargs["copy_to"] = str(copy_to)
3639
+ if store is not DEFAULT:
3640
+ kwargs["store"] = store
3641
+ if meta is not DEFAULT:
3642
+ kwargs["meta"] = meta
3643
+ if properties is not DEFAULT:
3644
+ kwargs["properties"] = properties
3645
+ if ignore_above is not DEFAULT:
3646
+ kwargs["ignore_above"] = ignore_above
3647
+ if dynamic is not DEFAULT:
3648
+ kwargs["dynamic"] = dynamic
3649
+ if fields is not DEFAULT:
3650
+ kwargs["fields"] = fields
3651
+ if synthetic_source_keep is not DEFAULT:
3652
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3653
+ super().__init__(*args, **kwargs)
3654
+
3655
+
3656
+ class Short(Integer):
3657
+ """
3658
+ :arg null_value:
3659
+ :arg boost:
3660
+ :arg coerce:
3661
+ :arg ignore_malformed:
3662
+ :arg index:
3663
+ :arg on_script_error:
3664
+ :arg script:
3665
+ :arg time_series_metric: For internal use by Elastic only. Marks the
3666
+ field as a time series dimension. Defaults to false.
3667
+ :arg time_series_dimension: For internal use by Elastic only. Marks
3668
+ the field as a time series dimension. Defaults to false.
3669
+ :arg doc_values:
3670
+ :arg copy_to:
3671
+ :arg store:
3672
+ :arg meta: Metadata about the field.
3673
+ :arg properties:
3674
+ :arg ignore_above:
3675
+ :arg dynamic:
3676
+ :arg fields:
3677
+ :arg synthetic_source_keep:
3678
+ """
3679
+
3680
+ name = "short"
3681
+ _param_defs = {
3682
+ "properties": {"type": "field", "hash": True},
3683
+ "fields": {"type": "field", "hash": True},
3684
+ }
3685
+
3686
+ def __init__(
3687
+ self,
3688
+ *args: Any,
3689
+ null_value: Union[float, "DefaultType"] = DEFAULT,
3690
+ boost: Union[float, "DefaultType"] = DEFAULT,
3691
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
3692
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
3693
+ index: Union[bool, "DefaultType"] = DEFAULT,
3694
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
3695
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
3696
+ time_series_metric: Union[
3697
+ Literal["gauge", "counter", "summary", "histogram", "position"],
3698
+ "DefaultType",
3699
+ ] = DEFAULT,
3700
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
3701
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
3702
+ copy_to: Union[
3703
+ Union[str, "InstrumentedField"],
3704
+ Sequence[Union[str, "InstrumentedField"]],
3705
+ "DefaultType",
3706
+ ] = DEFAULT,
3707
+ store: Union[bool, "DefaultType"] = DEFAULT,
3708
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3709
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3710
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3711
+ dynamic: Union[
3712
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3713
+ ] = DEFAULT,
3714
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3715
+ synthetic_source_keep: Union[
3716
+ Literal["none", "arrays", "all"], "DefaultType"
3717
+ ] = DEFAULT,
3718
+ **kwargs: Any,
3719
+ ):
3720
+ if null_value is not DEFAULT:
3721
+ kwargs["null_value"] = null_value
3722
+ if boost is not DEFAULT:
3723
+ kwargs["boost"] = boost
3724
+ if coerce is not DEFAULT:
3725
+ kwargs["coerce"] = coerce
3726
+ if ignore_malformed is not DEFAULT:
3727
+ kwargs["ignore_malformed"] = ignore_malformed
3728
+ if index is not DEFAULT:
3729
+ kwargs["index"] = index
3730
+ if on_script_error is not DEFAULT:
3731
+ kwargs["on_script_error"] = on_script_error
3732
+ if script is not DEFAULT:
3733
+ kwargs["script"] = script
3734
+ if time_series_metric is not DEFAULT:
3735
+ kwargs["time_series_metric"] = time_series_metric
3736
+ if time_series_dimension is not DEFAULT:
3737
+ kwargs["time_series_dimension"] = time_series_dimension
3738
+ if doc_values is not DEFAULT:
3739
+ kwargs["doc_values"] = doc_values
3740
+ if copy_to is not DEFAULT:
3741
+ kwargs["copy_to"] = str(copy_to)
3742
+ if store is not DEFAULT:
3743
+ kwargs["store"] = store
3744
+ if meta is not DEFAULT:
3745
+ kwargs["meta"] = meta
3746
+ if properties is not DEFAULT:
3747
+ kwargs["properties"] = properties
3748
+ if ignore_above is not DEFAULT:
3749
+ kwargs["ignore_above"] = ignore_above
3750
+ if dynamic is not DEFAULT:
3751
+ kwargs["dynamic"] = dynamic
3752
+ if fields is not DEFAULT:
3753
+ kwargs["fields"] = fields
3754
+ if synthetic_source_keep is not DEFAULT:
3755
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3756
+ super().__init__(*args, **kwargs)
3757
+
3758
+
3759
+ class SparseVector(Field):
3760
+ """
3761
+ :arg meta: Metadata about the field.
3762
+ :arg properties:
3763
+ :arg ignore_above:
3764
+ :arg dynamic:
3765
+ :arg fields:
3766
+ :arg synthetic_source_keep:
3767
+ """
3768
+
3769
+ name = "sparse_vector"
3770
+ _param_defs = {
3771
+ "properties": {"type": "field", "hash": True},
3772
+ "fields": {"type": "field", "hash": True},
3773
+ }
3774
+
3775
+ def __init__(
3776
+ self,
3777
+ *args: Any,
3778
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3779
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3780
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3781
+ dynamic: Union[
3782
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3783
+ ] = DEFAULT,
3784
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3785
+ synthetic_source_keep: Union[
3786
+ Literal["none", "arrays", "all"], "DefaultType"
3787
+ ] = DEFAULT,
3788
+ **kwargs: Any,
3789
+ ):
3790
+ if meta is not DEFAULT:
3791
+ kwargs["meta"] = meta
3792
+ if properties is not DEFAULT:
3793
+ kwargs["properties"] = properties
3794
+ if ignore_above is not DEFAULT:
3795
+ kwargs["ignore_above"] = ignore_above
3796
+ if dynamic is not DEFAULT:
3797
+ kwargs["dynamic"] = dynamic
3798
+ if fields is not DEFAULT:
3799
+ kwargs["fields"] = fields
3800
+ if synthetic_source_keep is not DEFAULT:
3801
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3802
+ super().__init__(*args, **kwargs)
3803
+
3804
+
3805
+ class Text(Field):
3806
+ """
3807
+ :arg analyzer:
3808
+ :arg boost:
3809
+ :arg eager_global_ordinals:
3810
+ :arg fielddata:
3811
+ :arg fielddata_frequency_filter:
3812
+ :arg index:
3813
+ :arg index_options:
3814
+ :arg index_phrases:
3815
+ :arg index_prefixes:
3816
+ :arg norms:
3817
+ :arg position_increment_gap:
3818
+ :arg search_analyzer:
3819
+ :arg search_quote_analyzer:
3820
+ :arg similarity:
3821
+ :arg term_vector:
3822
+ :arg copy_to:
3823
+ :arg store:
3824
+ :arg meta: Metadata about the field.
3825
+ :arg properties:
3826
+ :arg ignore_above:
3827
+ :arg dynamic:
3828
+ :arg fields:
3829
+ :arg synthetic_source_keep:
3830
+ """
3831
+
3832
+ name = "text"
3833
+ _param_defs = {
3834
+ "analyzer": {"type": "analyzer"},
3835
+ "search_analyzer": {"type": "analyzer"},
3836
+ "search_quote_analyzer": {"type": "analyzer"},
3837
+ "properties": {"type": "field", "hash": True},
3838
+ "fields": {"type": "field", "hash": True},
3839
+ }
3840
+
3841
+ def __init__(
3842
+ self,
3843
+ *args: Any,
3844
+ analyzer: Union[str, DslBase, "DefaultType"] = DEFAULT,
3845
+ boost: Union[float, "DefaultType"] = DEFAULT,
3846
+ eager_global_ordinals: Union[bool, "DefaultType"] = DEFAULT,
3847
+ fielddata: Union[bool, "DefaultType"] = DEFAULT,
3848
+ fielddata_frequency_filter: Union[
3849
+ "types.FielddataFrequencyFilter", Dict[str, Any], "DefaultType"
3850
+ ] = DEFAULT,
3851
+ index: Union[bool, "DefaultType"] = DEFAULT,
3852
+ index_options: Union[
3853
+ Literal["docs", "freqs", "positions", "offsets"], "DefaultType"
3854
+ ] = DEFAULT,
3855
+ index_phrases: Union[bool, "DefaultType"] = DEFAULT,
3856
+ index_prefixes: Union[
3857
+ "types.TextIndexPrefixes", None, Dict[str, Any], "DefaultType"
3858
+ ] = DEFAULT,
3859
+ norms: Union[bool, "DefaultType"] = DEFAULT,
3860
+ position_increment_gap: Union[int, "DefaultType"] = DEFAULT,
3861
+ search_analyzer: Union[str, DslBase, "DefaultType"] = DEFAULT,
3862
+ search_quote_analyzer: Union[str, DslBase, "DefaultType"] = DEFAULT,
3863
+ similarity: Union[str, None, "DefaultType"] = DEFAULT,
3864
+ term_vector: Union[
3865
+ Literal[
3866
+ "no",
3867
+ "yes",
3868
+ "with_offsets",
3869
+ "with_positions",
3870
+ "with_positions_offsets",
3871
+ "with_positions_offsets_payloads",
3872
+ "with_positions_payloads",
3873
+ ],
3874
+ "DefaultType",
3875
+ ] = DEFAULT,
3876
+ copy_to: Union[
3877
+ Union[str, "InstrumentedField"],
3878
+ Sequence[Union[str, "InstrumentedField"]],
3879
+ "DefaultType",
3880
+ ] = DEFAULT,
3881
+ store: Union[bool, "DefaultType"] = DEFAULT,
3882
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3883
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3884
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3885
+ dynamic: Union[
3886
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3887
+ ] = DEFAULT,
3888
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3889
+ synthetic_source_keep: Union[
3890
+ Literal["none", "arrays", "all"], "DefaultType"
3891
+ ] = DEFAULT,
3892
+ **kwargs: Any,
3893
+ ):
3894
+ if analyzer is not DEFAULT:
3895
+ kwargs["analyzer"] = analyzer
3896
+ if boost is not DEFAULT:
3897
+ kwargs["boost"] = boost
3898
+ if eager_global_ordinals is not DEFAULT:
3899
+ kwargs["eager_global_ordinals"] = eager_global_ordinals
3900
+ if fielddata is not DEFAULT:
3901
+ kwargs["fielddata"] = fielddata
3902
+ if fielddata_frequency_filter is not DEFAULT:
3903
+ kwargs["fielddata_frequency_filter"] = fielddata_frequency_filter
3904
+ if index is not DEFAULT:
3905
+ kwargs["index"] = index
3906
+ if index_options is not DEFAULT:
3907
+ kwargs["index_options"] = index_options
3908
+ if index_phrases is not DEFAULT:
3909
+ kwargs["index_phrases"] = index_phrases
3910
+ if index_prefixes is not DEFAULT:
3911
+ kwargs["index_prefixes"] = index_prefixes
3912
+ if norms is not DEFAULT:
3913
+ kwargs["norms"] = norms
3914
+ if position_increment_gap is not DEFAULT:
3915
+ kwargs["position_increment_gap"] = position_increment_gap
3916
+ if search_analyzer is not DEFAULT:
3917
+ kwargs["search_analyzer"] = search_analyzer
3918
+ if search_quote_analyzer is not DEFAULT:
3919
+ kwargs["search_quote_analyzer"] = search_quote_analyzer
3920
+ if similarity is not DEFAULT:
3921
+ kwargs["similarity"] = similarity
3922
+ if term_vector is not DEFAULT:
3923
+ kwargs["term_vector"] = term_vector
3924
+ if copy_to is not DEFAULT:
3925
+ kwargs["copy_to"] = str(copy_to)
3926
+ if store is not DEFAULT:
3927
+ kwargs["store"] = store
3928
+ if meta is not DEFAULT:
3929
+ kwargs["meta"] = meta
3930
+ if properties is not DEFAULT:
3931
+ kwargs["properties"] = properties
3932
+ if ignore_above is not DEFAULT:
3933
+ kwargs["ignore_above"] = ignore_above
3934
+ if dynamic is not DEFAULT:
3935
+ kwargs["dynamic"] = dynamic
3936
+ if fields is not DEFAULT:
3937
+ kwargs["fields"] = fields
3938
+ if synthetic_source_keep is not DEFAULT:
3939
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
3940
+ super().__init__(*args, **kwargs)
3941
+
3942
+
3943
+ class TokenCount(Field):
3944
+ """
3945
+ :arg analyzer:
3946
+ :arg boost:
3947
+ :arg index:
3948
+ :arg null_value:
3949
+ :arg enable_position_increments:
3950
+ :arg doc_values:
3951
+ :arg copy_to:
3952
+ :arg store:
3953
+ :arg meta: Metadata about the field.
3954
+ :arg properties:
3955
+ :arg ignore_above:
3956
+ :arg dynamic:
3957
+ :arg fields:
3958
+ :arg synthetic_source_keep:
3959
+ """
3960
+
3961
+ name = "token_count"
3962
+ _param_defs = {
3963
+ "analyzer": {"type": "analyzer"},
3964
+ "properties": {"type": "field", "hash": True},
3965
+ "fields": {"type": "field", "hash": True},
3966
+ }
3967
+
3968
+ def __init__(
3969
+ self,
3970
+ *args: Any,
3971
+ analyzer: Union[str, DslBase, "DefaultType"] = DEFAULT,
3972
+ boost: Union[float, "DefaultType"] = DEFAULT,
3973
+ index: Union[bool, "DefaultType"] = DEFAULT,
3974
+ null_value: Union[float, "DefaultType"] = DEFAULT,
3975
+ enable_position_increments: Union[bool, "DefaultType"] = DEFAULT,
3976
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
3977
+ copy_to: Union[
3978
+ Union[str, "InstrumentedField"],
3979
+ Sequence[Union[str, "InstrumentedField"]],
3980
+ "DefaultType",
3981
+ ] = DEFAULT,
3982
+ store: Union[bool, "DefaultType"] = DEFAULT,
3983
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
3984
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3985
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
3986
+ dynamic: Union[
3987
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
3988
+ ] = DEFAULT,
3989
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
3990
+ synthetic_source_keep: Union[
3991
+ Literal["none", "arrays", "all"], "DefaultType"
3992
+ ] = DEFAULT,
3993
+ **kwargs: Any,
3994
+ ):
3995
+ if analyzer is not DEFAULT:
3996
+ kwargs["analyzer"] = analyzer
3997
+ if boost is not DEFAULT:
3998
+ kwargs["boost"] = boost
3999
+ if index is not DEFAULT:
4000
+ kwargs["index"] = index
4001
+ if null_value is not DEFAULT:
4002
+ kwargs["null_value"] = null_value
4003
+ if enable_position_increments is not DEFAULT:
4004
+ kwargs["enable_position_increments"] = enable_position_increments
4005
+ if doc_values is not DEFAULT:
4006
+ kwargs["doc_values"] = doc_values
4007
+ if copy_to is not DEFAULT:
4008
+ kwargs["copy_to"] = str(copy_to)
4009
+ if store is not DEFAULT:
4010
+ kwargs["store"] = store
4011
+ if meta is not DEFAULT:
4012
+ kwargs["meta"] = meta
4013
+ if properties is not DEFAULT:
4014
+ kwargs["properties"] = properties
4015
+ if ignore_above is not DEFAULT:
4016
+ kwargs["ignore_above"] = ignore_above
4017
+ if dynamic is not DEFAULT:
4018
+ kwargs["dynamic"] = dynamic
4019
+ if fields is not DEFAULT:
4020
+ kwargs["fields"] = fields
4021
+ if synthetic_source_keep is not DEFAULT:
4022
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
4023
+ super().__init__(*args, **kwargs)
4024
+
4025
+
4026
+ class UnsignedLong(Field):
4027
+ """
4028
+ :arg null_value:
4029
+ :arg boost:
4030
+ :arg coerce:
4031
+ :arg ignore_malformed:
4032
+ :arg index:
4033
+ :arg on_script_error:
4034
+ :arg script:
4035
+ :arg time_series_metric: For internal use by Elastic only. Marks the
4036
+ field as a time series dimension. Defaults to false.
4037
+ :arg time_series_dimension: For internal use by Elastic only. Marks
4038
+ the field as a time series dimension. Defaults to false.
4039
+ :arg doc_values:
4040
+ :arg copy_to:
4041
+ :arg store:
4042
+ :arg meta: Metadata about the field.
4043
+ :arg properties:
4044
+ :arg ignore_above:
4045
+ :arg dynamic:
4046
+ :arg fields:
4047
+ :arg synthetic_source_keep:
4048
+ """
4049
+
4050
+ name = "unsigned_long"
4051
+ _param_defs = {
4052
+ "properties": {"type": "field", "hash": True},
4053
+ "fields": {"type": "field", "hash": True},
4054
+ }
4055
+
4056
+ def __init__(
4057
+ self,
4058
+ *args: Any,
4059
+ null_value: Union[int, "DefaultType"] = DEFAULT,
4060
+ boost: Union[float, "DefaultType"] = DEFAULT,
4061
+ coerce: Union[bool, "DefaultType"] = DEFAULT,
4062
+ ignore_malformed: Union[bool, "DefaultType"] = DEFAULT,
4063
+ index: Union[bool, "DefaultType"] = DEFAULT,
4064
+ on_script_error: Union[Literal["fail", "continue"], "DefaultType"] = DEFAULT,
4065
+ script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
4066
+ time_series_metric: Union[
4067
+ Literal["gauge", "counter", "summary", "histogram", "position"],
4068
+ "DefaultType",
4069
+ ] = DEFAULT,
4070
+ time_series_dimension: Union[bool, "DefaultType"] = DEFAULT,
4071
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
4072
+ copy_to: Union[
4073
+ Union[str, "InstrumentedField"],
4074
+ Sequence[Union[str, "InstrumentedField"]],
4075
+ "DefaultType",
4076
+ ] = DEFAULT,
4077
+ store: Union[bool, "DefaultType"] = DEFAULT,
4078
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
4079
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
4080
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
4081
+ dynamic: Union[
4082
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
4083
+ ] = DEFAULT,
4084
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
4085
+ synthetic_source_keep: Union[
4086
+ Literal["none", "arrays", "all"], "DefaultType"
4087
+ ] = DEFAULT,
4088
+ **kwargs: Any,
4089
+ ):
4090
+ if null_value is not DEFAULT:
4091
+ kwargs["null_value"] = null_value
4092
+ if boost is not DEFAULT:
4093
+ kwargs["boost"] = boost
4094
+ if coerce is not DEFAULT:
4095
+ kwargs["coerce"] = coerce
4096
+ if ignore_malformed is not DEFAULT:
4097
+ kwargs["ignore_malformed"] = ignore_malformed
4098
+ if index is not DEFAULT:
4099
+ kwargs["index"] = index
4100
+ if on_script_error is not DEFAULT:
4101
+ kwargs["on_script_error"] = on_script_error
4102
+ if script is not DEFAULT:
4103
+ kwargs["script"] = script
4104
+ if time_series_metric is not DEFAULT:
4105
+ kwargs["time_series_metric"] = time_series_metric
4106
+ if time_series_dimension is not DEFAULT:
4107
+ kwargs["time_series_dimension"] = time_series_dimension
4108
+ if doc_values is not DEFAULT:
4109
+ kwargs["doc_values"] = doc_values
4110
+ if copy_to is not DEFAULT:
4111
+ kwargs["copy_to"] = str(copy_to)
4112
+ if store is not DEFAULT:
4113
+ kwargs["store"] = store
4114
+ if meta is not DEFAULT:
4115
+ kwargs["meta"] = meta
4116
+ if properties is not DEFAULT:
4117
+ kwargs["properties"] = properties
4118
+ if ignore_above is not DEFAULT:
4119
+ kwargs["ignore_above"] = ignore_above
4120
+ if dynamic is not DEFAULT:
4121
+ kwargs["dynamic"] = dynamic
4122
+ if fields is not DEFAULT:
4123
+ kwargs["fields"] = fields
4124
+ if synthetic_source_keep is not DEFAULT:
4125
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
4126
+ super().__init__(*args, **kwargs)
4127
+
4128
+
4129
+ class Version(Field):
4130
+ """
4131
+ :arg doc_values:
4132
+ :arg copy_to:
4133
+ :arg store:
4134
+ :arg meta: Metadata about the field.
4135
+ :arg properties:
4136
+ :arg ignore_above:
4137
+ :arg dynamic:
4138
+ :arg fields:
4139
+ :arg synthetic_source_keep:
4140
+ """
4141
+
4142
+ name = "version"
4143
+ _param_defs = {
4144
+ "properties": {"type": "field", "hash": True},
4145
+ "fields": {"type": "field", "hash": True},
4146
+ }
4147
+
4148
+ def __init__(
4149
+ self,
4150
+ *args: Any,
4151
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
4152
+ copy_to: Union[
4153
+ Union[str, "InstrumentedField"],
4154
+ Sequence[Union[str, "InstrumentedField"]],
4155
+ "DefaultType",
4156
+ ] = DEFAULT,
4157
+ store: Union[bool, "DefaultType"] = DEFAULT,
4158
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
4159
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
4160
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
4161
+ dynamic: Union[
4162
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
4163
+ ] = DEFAULT,
4164
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
4165
+ synthetic_source_keep: Union[
4166
+ Literal["none", "arrays", "all"], "DefaultType"
4167
+ ] = DEFAULT,
4168
+ **kwargs: Any,
4169
+ ):
4170
+ if doc_values is not DEFAULT:
4171
+ kwargs["doc_values"] = doc_values
4172
+ if copy_to is not DEFAULT:
4173
+ kwargs["copy_to"] = str(copy_to)
4174
+ if store is not DEFAULT:
4175
+ kwargs["store"] = store
4176
+ if meta is not DEFAULT:
4177
+ kwargs["meta"] = meta
4178
+ if properties is not DEFAULT:
4179
+ kwargs["properties"] = properties
4180
+ if ignore_above is not DEFAULT:
4181
+ kwargs["ignore_above"] = ignore_above
4182
+ if dynamic is not DEFAULT:
4183
+ kwargs["dynamic"] = dynamic
4184
+ if fields is not DEFAULT:
4185
+ kwargs["fields"] = fields
4186
+ if synthetic_source_keep is not DEFAULT:
4187
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
4188
+ super().__init__(*args, **kwargs)
4189
+
4190
+
4191
+ class Wildcard(Field):
4192
+ """
4193
+ :arg null_value:
4194
+ :arg doc_values:
4195
+ :arg copy_to:
4196
+ :arg store:
4197
+ :arg meta: Metadata about the field.
4198
+ :arg properties:
4199
+ :arg ignore_above:
4200
+ :arg dynamic:
4201
+ :arg fields:
4202
+ :arg synthetic_source_keep:
4203
+ """
4204
+
4205
+ name = "wildcard"
4206
+ _param_defs = {
4207
+ "properties": {"type": "field", "hash": True},
4208
+ "fields": {"type": "field", "hash": True},
4209
+ }
4210
+
4211
+ def __init__(
4212
+ self,
4213
+ *args: Any,
4214
+ null_value: Union[str, "DefaultType"] = DEFAULT,
4215
+ doc_values: Union[bool, "DefaultType"] = DEFAULT,
4216
+ copy_to: Union[
4217
+ Union[str, "InstrumentedField"],
4218
+ Sequence[Union[str, "InstrumentedField"]],
4219
+ "DefaultType",
4220
+ ] = DEFAULT,
4221
+ store: Union[bool, "DefaultType"] = DEFAULT,
4222
+ meta: Union[Mapping[str, str], "DefaultType"] = DEFAULT,
4223
+ properties: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
4224
+ ignore_above: Union[int, "DefaultType"] = DEFAULT,
4225
+ dynamic: Union[
4226
+ Literal["strict", "runtime", "true", "false"], bool, "DefaultType"
4227
+ ] = DEFAULT,
4228
+ fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
4229
+ synthetic_source_keep: Union[
4230
+ Literal["none", "arrays", "all"], "DefaultType"
4231
+ ] = DEFAULT,
4232
+ **kwargs: Any,
4233
+ ):
4234
+ if null_value is not DEFAULT:
4235
+ kwargs["null_value"] = null_value
4236
+ if doc_values is not DEFAULT:
4237
+ kwargs["doc_values"] = doc_values
4238
+ if copy_to is not DEFAULT:
4239
+ kwargs["copy_to"] = str(copy_to)
4240
+ if store is not DEFAULT:
4241
+ kwargs["store"] = store
4242
+ if meta is not DEFAULT:
4243
+ kwargs["meta"] = meta
4244
+ if properties is not DEFAULT:
4245
+ kwargs["properties"] = properties
4246
+ if ignore_above is not DEFAULT:
4247
+ kwargs["ignore_above"] = ignore_above
4248
+ if dynamic is not DEFAULT:
4249
+ kwargs["dynamic"] = dynamic
4250
+ if fields is not DEFAULT:
4251
+ kwargs["fields"] = fields
4252
+ if synthetic_source_keep is not DEFAULT:
4253
+ kwargs["synthetic_source_keep"] = synthetic_source_keep
4254
+ super().__init__(*args, **kwargs)