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