Qore ElasticSearchDataProvider Module Reference 1.0
Loading...
Searching...
No Matches
ElasticSearchDocumentUpdateDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
28
31
32public:
35
37 const ProviderInfo = <DataProviderInfo>{
38 "name": "update",
39 "desc": "ElasticSearch document update API data provider",
40 "type": "ElasticSearchDocumentUpdateDataProvider",
42 "supports_request": True,
43 };
44
46 const ProviderSummaryInfo = cast<hash<DataProviderSummaryInfo>>(ProviderInfo{
47 AbstractDataProvider::DataProviderSummaryInfoKeys
48 });
49
52
55
57 const QueryArgs = ...;
58
59
61 constructor(*hash<auto> options);
62
63
66
67
69 string getName();
70
71
73 *string getDesc();
74
75
77
82protected:
83 auto doRequestImpl(auto req, *hash<auto> request_options);
84public:
85
86
88
90protected:
92public:
93
94
96
98protected:
100public:
101
102
104 hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
105
106};
107
110
111public:
112protected:
114 const Fields = {
115 // query parameters
116 "index": {
117 "type": StringType,
118 "desc": "The name of the index to use",
119 },
120 "id": {
121 "type": StringType,
122 "desc": "The ID of the document to update",
123 },
124 "if_seq_no": {
125 "type": IntOrNothingType,
126 "desc": "Only perform the operation if the document has this sequence number",
127 },
128 "if_primary_term": {
129 "type": IntOrNothingType,
130 "desc": "Only perform the operation if the document has this primary term",
131 },
132 "lang": {
133 "type": StringOrNothingType,
134 "desc": "The script language (default `painless`)",
135 },
136 "require_alias": {
137 "type": SoftBoolStringType,
138 "desc": "If `true` (default `false`), the destination must be an index alias",
139 },
140 "refresh": {
141 "type": StringOrNothingType,
142 "desc": "If `true` (default `false`), Elasticsearch refreshes the affected shards to make this "
143 "operation visible to search, if `wait_for` then wait for a refresh to make this operation "
144 "visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`",
145 },
146 "retry_on_conflict": {
147 "type": IntOrNothingType,
148 "desc": "Specify how many times should the operation be retried when a conflict occurs (default `0`)",
149 },
150 "routing": {
151 "type": StringOrNothingType,
152 "desc": "Custom value used to route operations to a specific shard",
153 },
154 "_source": {
155 "type": StringOrNothingType,
156 "desc": "Set to `false` to disable source retrieval (default: `true`). You can also specify a "
157 "comma-separated list of the fields you want to retrieve",
158 },
159 "_source_excludes": {
160 "type": StringOrNothingType,
161 "desc": "Specify the source fields you want to exclude",
162 },
163 "_source_includes": {
164 "type": StringOrNothingType,
165 "desc": "Specify the source fields you want to exclude",
166 },
167 "timeout": {
168 "type": StringOrNothingType,
169 "desc": "Period to wait for the following operations:\n"
170 "- Dynamic mapping updates\n"
171 "- Waiting for active shards\n\n"
172 "This guarantees Elasticsearch waits for at least the timeout before failing. The actual wait "
173 "time could be longer, particularly when multiple waits occur (default `1m)",
174 },
175 "wait_for_active_shards": {
176 "type": StringOrNothingType,
177 "desc": "The number of shard copies that must be active before proceeding with the operation "
178 "(default `1`). Set to `all` or any positive integer up to the total number of shards in the "
179 "index (number_of_replicas+1)",
180 },
181
182 # body parameters
183 "script": {
184 "type": AutoType,
185 "desc": "the script to run",
186 },
187 "doc": {
188 "type": AutoHashOrNothingType,
189 "desc": "Updates the document with the given hash; ignored if `script` is also provided",
190 },
191 "detect_noop": {
192 "type": BoolOrNothingType,
193 "desc": "Ignore noops",
194 },
195 "doc_as_upsert": {
196 "type": BoolOrNothingType,
197 "desc": "Instead of sending a partial doc plus an upsert doc, you can set `doc_as_upsert` to `true` "
198 "to use the contents of `doc` as the upsert value",
199 },
200 "scripted_upsert": {
201 "type": BoolOrNothingType,
202 "desc": "To run the script whether or not the document exists",
203 },
204 "upsert": {
205 "type": AutoHashOrNothingType,
206 "desc": "Hash to insert as a new document if the document did not exist previously",
207 },
208 };
209
210public:
211
214
215};
216
219
220public:
221protected:
223 const Fields = {
224 "_index": {
225 "type": StringType,
226 "desc": "The name of the index the document was added to",
227 },
228 "_id": {
229 "type": StringType,
230 "desc": "The unique identifier for the added document",
231 },
232 "_version": {
233 "type": IntType,
234 "desc": "The document version. Incremented each time the document is updated",
235 },
236 "result": {
237 "type": StringType,
238 "desc": "The result of the indexing operation, `noop` or `updated`",
239 },
240 "_shards": {
242 "desc": "Provides information about the replication process of the index operation",
243 },
244 "_seq_no": {
245 "type": IntType,
246 "desc": "The sequence number assigned to the document for the indexing operation. Sequence numbers "
247 "are used to ensure an older version of a document doesn’t overwrite a newer version",
248 },
249 "_primary_term": {
250 "type": IntType,
251 "desc": "The primary term assigned to the document for the indexing operation",
252 },
253 "get": {
254 "type": AutoHashOrNothingType,
255 "desc": "Information about the document after the update"
256 },
257 };
258
259public:
260
263
264};
265};
const ConstructorOptions
Constructor options.
Definition: ElasticSearchDataProvider.qc.dox.h:64
Shard data type.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:188
The ElasticSearch document update API data provider.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:30
const ResponseType
Response type.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:54
const QueryArgs
Query args.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:57
RestClient::RestClient rest
REST client connection.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:34
constructor(RestClient::RestClient rest)
Creates the object from a REST connection.
const ProviderInfo
Provider info.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:37
const RequestType
Request type.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:51
*string getDesc()
Returns the data provider description.
auto doRequestImpl(auto req, *hash< auto > request_options)
Makes a request and returns the response.
*DataProvider::AbstractDataProviderType getResponseTypeImpl()
Returns the description of a response message, if this object represents a response message.
constructor(*hash< auto > options)
Creates the object from constructor options.
const ProviderSummaryInfo
Provider summary info.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:46
*DataProvider::AbstractDataProviderType getRequestTypeImpl()
Returns the description of a successful request message, if any.
hash< DataProvider::DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
Update document request data type.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:109
const Fields
Field descriptions.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:114
Document update API response.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:218
const Fields
Field descriptions.
Definition: ElasticSearchDocumentUpdateDataProvider.qc.dox.h:223
Boolean string type.
Definition: ElasticSearchDataProvider.qc.dox.h:140
Qore ElasticSearchDataProvider module definition.
Definition: ElasticSearchAcknowledgedDataType.qc.dox.h:26