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
Copy file name to clipboardExpand all lines: specification/_global/delete/DeleteRequest.ts
+59-12Lines changed: 59 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -33,11 +33,50 @@ import { Duration } from '@_types/Time'
33
33
34
34
/**
35
35
* Delete a document.
36
-
* Removes a JSON document from the specified index.
36
+
*
37
+
* Remove a JSON document from the specified index.
38
+
*
39
+
* NOTE: You cannot send deletion requests directly to a data stream.
40
+
* To delete a document in a data stream, you must target the backing index containing the document.
41
+
*
42
+
* **Optimistic concurrency control**
43
+
*
44
+
* Delete operations can be made conditional and only be performed if the last modification to the document was assigned the sequence number and primary term specified by the `if_seq_no` and `if_primary_term` parameters.
45
+
* If a mismatch is detected, the operation will result in a `VersionConflictException` and a status code of `409`.
46
+
*
47
+
* **Versioning**
48
+
*
49
+
* Each document indexed is versioned.
50
+
* When deleting a document, the version can be specified to make sure the relevant document you are trying to delete is actually being deleted and it has not changed in the meantime.
51
+
* Every write operation run on a document, deletes included, causes its version to be incremented.
52
+
* The version number of a deleted document remains available for a short time after deletion to allow for control of concurrent operations.
53
+
* The length of time for which a deleted document's version remains available is determined by the `index.gc_deletes` index setting.
54
+
*
55
+
* **Routing**
56
+
*
57
+
* If routing is used during indexing, the routing value also needs to be specified to delete a document.
58
+
*
59
+
* If the `_routing` mapping is set to `required` and no routing value is specified, the delete API throws a `RoutingMissingException` and rejects the request.
60
+
*
61
+
* For example:
62
+
*
63
+
* ```
64
+
* DELETE /my-index-000001/_doc/1?routing=shard-1
65
+
* ```
66
+
*
67
+
* This request deletes the document with ID 1, but it is routed based on the user.
68
+
* The document is not deleted if the correct routing is not specified.
69
+
*
70
+
* **Distributed**
71
+
*
72
+
* The delete operation gets hashed into a specific shard ID.
73
+
* It then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group.
* Only perform the operation if the document has this primary term.
101
+
* @ext_doc_id optimistic-concurrency
62
102
*/
63
103
if_primary_term?: long
64
104
/**
65
105
* Only perform the operation if the document has this sequence number.
106
+
* @ext_doc_id optimistic-concurrency
66
107
*/
67
108
if_seq_no?: SequenceNumber
68
109
/**
69
-
* If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes.
70
-
* Valid values: `true`, `false`, `wait_for`.
110
+
* If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search.
111
+
* If `wait_for`, it waits for a refresh to make this operation visible to search.
112
+
* If `false`, it does nothing with refreshes.
71
113
* @server_default false
72
114
*/
73
115
refresh?: Refresh
74
116
/**
75
-
* Custom value used to route operations to a specific shard.
117
+
* A custom value used to route operations to a specific shard.
76
118
*/
77
119
routing?: Routing
78
120
/**
79
-
* Period to wait for active shards.
121
+
* The period to wait for active shards.
122
+
*
123
+
* This parameter is useful for situations where the primary shard assigned to perform the delete operation might not be available when the delete operation runs.
124
+
* Some reasons for this might be that the primary shard is currently recovering from a store or undergoing relocation.
125
+
* By default, the delete operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error.
80
126
* @server_default 1m
81
127
*/
82
128
timeout?: Duration
83
129
/**
84
-
* Explicit version number for concurrency control.
85
-
* The specified version must match the current version of the document for the request to succeed.
130
+
* An explicit version number for concurrency control.
131
+
* It must match the current version of the document for the request to succeed.
86
132
*/
87
133
version?: VersionNumber
88
134
/**
89
-
* Specific version type: `external`, `external_gte`.
135
+
* The version type.
90
136
*/
91
137
version_type?: VersionType
92
138
/**
93
-
* The number of shard copies that must be active before proceeding with the operation.
94
-
* Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
139
+
* The minimum number of shard copies that must be active before proceeding with the operation.
140
+
* You can set it to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
141
+
* The default value of `1` means it waits for each primary shard to be active.
Copy file name to clipboardExpand all lines: specification/_global/index/IndexRequest.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ import { Duration } from '@_types/Time'
74
74
* **Optimistic concurrency control**
75
75
*
76
76
* Index operations can be made conditional and only be performed if the last modification to the document was assigned the sequence number and primary term specified by the `if_seq_no` and `if_primary_term` parameters.
77
-
* If a mismatch is detected, the operation will result in a `VersionConflictException` and a status code of 409.
77
+
* If a mismatch is detected, the operation will result in a `VersionConflictException` and a status code of `409`.
0 commit comments