You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes.
93
+
* If `true`, the request refreshes the relevant shards before retrieving the document.
94
+
* Setting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
71
95
* @server_default false
72
96
*/
73
97
refresh?: boolean
74
98
/**
75
-
* Target the specified primary shard.
76
-
* @doc_id routing
99
+
* A custom value used to route operations to a specific shard.
100
+
* @ext_doc_id routing
77
101
*/
78
102
routing?: Routing
79
103
/**
80
-
* `true` or `false` to return the `_source` field or not, or a list of fields to return.
104
+
* Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return.
81
105
*/
82
106
_source?: SourceConfigParam
83
107
/**
84
-
* A comma-separated list of source fields to exclude in the response.
108
+
* A comma-separated list of source fields to exclude from the response.
109
+
* You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
110
+
* If the `_source` parameter is `false`, this parameter is ignored.
85
111
*/
86
112
_source_excludes?: Fields
87
113
/**
88
114
* A comma-separated list of source fields to include in the response.
115
+
* If this parameter is specified, only these source fields are returned.
116
+
* You can exclude fields from this subset using the `_source_excludes` query parameter.
117
+
* If the `_source` parameter is `false`, this parameter is ignored.
89
118
*/
90
119
_source_includes?: Fields
91
120
/**
92
-
* List of stored fields to return as part of a hit.
121
+
* A comma-separated list of stored fields to return as part of a hit.
93
122
* If no fields are specified, no stored fields are included in the response.
94
-
* If this field is specified, the `_source` parameter defaults to false.
123
+
* If this field is specified, the `_source` parameter defaults to `false`.
* Comma-separated list of data streams, indices, and aliases.
53
-
* Supports wildcards (`*`).
63
+
* A comma-separated list of data streams, indices, and aliases.
64
+
* It supports wildcards (`*`).
54
65
*/
55
66
index: IndexName
56
67
}
57
68
query_parameters: {
58
69
/**
59
-
* Specifies the node or shard the operation should be performed on.
60
-
* Random by default.
70
+
* The node or shard the operation should be performed on.
71
+
* By default, the operation is randomized between the shard replicas.
61
72
*/
62
73
preference?: string
63
74
/**
64
-
* If true, the request is real-time as opposed to near-real-time.
75
+
* If `true`, the request is real-time as opposed to near-real-time.
65
76
* @server_default true
66
-
* @doc_id realtime
77
+
* @ext_doc_id realtime
67
78
*/
68
79
realtime?: boolean
69
80
/**
70
-
* If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes.
81
+
* If `true`, the request refreshes the relevant shards before retrieving the document.
82
+
* Setting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
71
83
* @server_default false
72
84
*/
73
85
refresh?: boolean
74
86
/**
75
-
* Target the specified primary shard.
76
-
* @doc_id routing
87
+
* A custom value used to route operations to a specific shard.
88
+
* @ext_doc_id routing
77
89
*/
78
90
routing?: Routing
79
91
/**
80
-
* `true` or `false` to return the `_source` field or not, or a list of fields to return.
92
+
* Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return.
Copy file name to clipboardExpand all lines: specification/_global/get/GetRequest.ts
+89-16Lines changed: 89 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -30,11 +30,69 @@ import {
30
30
31
31
/**
32
32
* Get a document by its ID.
33
-
* Retrieves the document with the specified ID from an index.
33
+
*
34
+
* Get a document and its source or stored fields from an index.
35
+
*
36
+
* By default, this API is realtime and is not affected by the refresh rate of the index (when data will become visible for search).
37
+
* In the case where stored fields are requested with the `stored_fields` parameter and the document has been updated but is not yet refreshed, the API will have to parse and analyze the source to extract the stored fields.
38
+
* To turn off realtime behavior, set the `realtime` parameter to false.
39
+
*
40
+
* **Source filtering**
41
+
*
42
+
* By default, the API returns the contents of the `_source` field unless you have used the `stored_fields` parameter or the `_source` field is turned off.
43
+
* You can turn off `_source` retrieval by using the `_source` parameter:
44
+
*
45
+
* ```
46
+
* GET my-index-000001/_doc/0?_source=false
47
+
* ```
48
+
*
49
+
* If you only need one or two fields from the `_source`, use the `_source_includes` or `_source_excludes` parameters to include or filter out particular fields.
50
+
* This can be helpful with large documents where partial retrieval can save on network overhead
51
+
* Both parameters take a comma separated list of fields or wildcard expressions.
52
+
* For example:
53
+
*
54
+
* ```
55
+
* GET my-index-000001/_doc/0?_source_includes=*.id&_source_excludes=entities
56
+
* ```
57
+
*
58
+
* If you only want to specify includes, you can use a shorter notation:
59
+
*
60
+
* ```
61
+
* GET my-index-000001/_doc/0?_source=*.id
62
+
* ```
63
+
*
64
+
* **Routing**
65
+
*
66
+
* If routing is used during indexing, the routing value also needs to be specified to retrieve a document.
67
+
* For example:
68
+
*
69
+
* ```
70
+
* GET my-index-000001/_doc/2?routing=user1
71
+
* ```
72
+
*
73
+
* This request gets the document with ID 2, but it is routed based on the user.
74
+
* The document is not fetched if the correct routing is not specified.
75
+
*
76
+
* **Distributed**
77
+
*
78
+
* The GET operation is hashed into a specific shard ID.
79
+
* It is then redirected to one of the replicas within that shard ID and returns the result.
80
+
* The replicas are the primary shard and its replicas within that shard ID group.
81
+
* This means that the more replicas you have, the better your GET scaling will be.
82
+
*
83
+
* **Versioning support**
84
+
*
85
+
* You can use the `version` parameter to retrieve the document only if its current version is equal to the specified one.
86
+
*
87
+
* Internally, Elasticsearch has marked the old document as deleted and added an entirely new document.
88
+
* The old version of the document doesn't disappear immediately, although you won't be able to access it.
89
+
* Elasticsearch cleans up deleted documents in the background as you continue to index more data.
* If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes.
135
+
* If `true`, the request refreshes the relevant shards before retrieving the document.
136
+
* Setting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
72
137
* @server_default false
73
138
*/
74
139
refresh?: boolean
75
140
/**
76
-
* Target the specified primary shard.
77
-
* @doc_id routing
141
+
* A custom value used to route operations to a specific shard.
142
+
* @ext_doc_id routing
78
143
*/
79
144
routing?: Routing
80
145
/**
81
-
* True or false to return the _source field or not, or a list of fields to return.
146
+
* Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return.
82
147
*/
83
148
_source?: SourceConfigParam
84
149
/**
85
-
* A comma-separated list of source fields to exclude in the response.
150
+
* A comma-separated list of source fields to exclude from the response.
151
+
* You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
152
+
* If the `_source` parameter is `false`, this parameter is ignored.
86
153
*/
87
154
_source_excludes?: Fields
88
155
/**
89
156
* A comma-separated list of source fields to include in the response.
157
+
* If this parameter is specified, only these source fields are returned.
158
+
* You can exclude fields from this subset using the `_source_excludes` query parameter.
159
+
* If the `_source` parameter is `false`, this parameter is ignored.
90
160
*/
91
161
_source_includes?: Fields
92
162
/**
93
-
* List of stored fields to return as part of a hit.
163
+
* A comma-separated list of stored fields to return as part of a hit.
94
164
* If no fields are specified, no stored fields are included in the response.
95
-
* If this field is specified, the `_source` parameter defaults to false.
165
+
* If this field is specified, the `_source` parameter defaults to `false`.
166
+
* Only leaf fields can be retrieved with the `stored_field` option.
167
+
* Object fields can't be returned;if specified, the request fails.
96
168
*/
97
169
stored_fields?: Fields
98
170
/**
99
-
* Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
171
+
* The version number for concurrency control.
172
+
* It must match the current version of the document for the request to succeed.
100
173
*/
101
174
version?: VersionNumber
102
175
/**
103
-
* Specific version type: internal, external, external_gte.
0 commit comments