|
22 | 22 | Generic,
|
23 | 23 | Iterator,
|
24 | 24 | List,
|
| 25 | + Mapping, |
25 | 26 | Optional,
|
| 27 | + Sequence, |
26 | 28 | Tuple,
|
27 | 29 | Union,
|
28 | 30 | cast,
|
|
32 | 34 | from .hit import Hit, HitMeta
|
33 | 35 |
|
34 | 36 | if TYPE_CHECKING:
|
| 37 | + from .. import types |
35 | 38 | from ..aggs import Agg
|
36 | 39 | from ..faceted_search_base import FacetedSearchBase
|
37 | 40 | from ..search_base import Request, SearchBase
|
|
41 | 44 |
|
42 | 45 |
|
43 | 46 | class Response(AttrDict[Any], Generic[_R]):
|
| 47 | + """An Elasticsearch response. |
| 48 | +
|
| 49 | + :arg took: (required) |
| 50 | + :arg timed_out: (required) |
| 51 | + :arg _shards: (required) |
| 52 | + :arg hits: search results |
| 53 | + :arg aggregations: aggregation results |
| 54 | + :arg _clusters: |
| 55 | + :arg fields: |
| 56 | + :arg max_score: |
| 57 | + :arg num_reduce_phases: |
| 58 | + :arg profile: |
| 59 | + :arg pit_id: |
| 60 | + :arg _scroll_id: |
| 61 | + :arg suggest: |
| 62 | + :arg terminated_early: |
| 63 | + """ |
| 64 | + |
44 | 65 | _search: "SearchBase[_R]"
|
45 | 66 | _faceted_search: "FacetedSearchBase[_R]"
|
46 | 67 | _doc_class: Optional[_R]
|
47 | 68 | _hits: List[_R]
|
48 | 69 |
|
| 70 | + took: int |
| 71 | + timed_out: bool |
| 72 | + _shards: "types.ShardStatistics" |
| 73 | + _clusters: "types.ClusterStatistics" |
| 74 | + fields: Mapping[str, Any] |
| 75 | + max_score: float |
| 76 | + num_reduce_phases: int |
| 77 | + profile: "types.Profile" |
| 78 | + pit_id: str |
| 79 | + _scroll_id: str |
| 80 | + suggest: Mapping[ |
| 81 | + str, |
| 82 | + Sequence[ |
| 83 | + Union["types.CompletionSuggest", "types.PhraseSuggest", "types.TermSuggest"] |
| 84 | + ], |
| 85 | + ] |
| 86 | + terminated_early: bool |
| 87 | + |
49 | 88 | def __init__(
|
50 | 89 | self,
|
51 | 90 | search: "Request[_R]",
|
@@ -176,8 +215,45 @@ def __iter__(self) -> Iterator["Agg"]: # type: ignore[override]
|
176 | 215 |
|
177 | 216 |
|
178 | 217 | class UpdateByQueryResponse(AttrDict[Any], Generic[_R]):
|
| 218 | + """An Elasticsearch update by query response. |
| 219 | +
|
| 220 | + :arg batches: |
| 221 | + :arg failures: |
| 222 | + :arg noops: |
| 223 | + :arg deleted: |
| 224 | + :arg requests_per_second: |
| 225 | + :arg retries: |
| 226 | + :arg task: |
| 227 | + :arg timed_out: |
| 228 | + :arg took: |
| 229 | + :arg total: |
| 230 | + :arg updated: |
| 231 | + :arg version_conflicts: |
| 232 | + :arg throttled: |
| 233 | + :arg throttled_millis: |
| 234 | + :arg throttled_until: |
| 235 | + :arg throttled_until_millis: |
| 236 | + """ |
| 237 | + |
179 | 238 | _search: "UpdateByQueryBase[_R]"
|
180 | 239 |
|
| 240 | + batches: int |
| 241 | + failures: Sequence["types.BulkIndexByScrollFailure"] |
| 242 | + noops: int |
| 243 | + deleted: int |
| 244 | + requests_per_second: float |
| 245 | + retries: "types.Retries" |
| 246 | + task: Union[str, int] |
| 247 | + timed_out: bool |
| 248 | + took: Any |
| 249 | + total: int |
| 250 | + updated: int |
| 251 | + version_conflicts: int |
| 252 | + throttled: Any |
| 253 | + throttled_millis: Any |
| 254 | + throttled_until: Any |
| 255 | + throttled_until_millis: Any |
| 256 | + |
181 | 257 | def __init__(
|
182 | 258 | self,
|
183 | 259 | search: "Request[_R]",
|
|
0 commit comments