$darkmode
Qore ElasticSearchDataProvider Module Reference 1.0
ElasticSearchDocumentCreateDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
28
33
34public:
37
39 const ProviderInfo = <DataProviderInfo>{
40 "name": "create",
41 "desc": "ElasticSearch document create API data provider",
42 "type": "ElasticSearchDocumentCreateDataProvider",
44 "supports_request": True,
45 };
46
48 const ProviderSummaryInfo = cast<hash<DataProviderSummaryInfo>>(ProviderInfo{
49 AbstractDataProvider::DataProviderSummaryInfoKeys
50 });
51
54
57
59 const QueryArgs = ...;
60
61
63 constructor(*hash<auto> options);
64
65
68
69
71 string getName();
72
73
75 *string getDesc();
76
77
79
84protected:
85 auto doRequestImpl(auto req, *hash<auto> request_options);
86public:
87
88
90
92protected:
94public:
95
96
98
100protected:
102public:
103
104
106 hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
107
108};
109
112
113public:
114protected:
116 const Fields = {
117 // query parameters
118 "index": {
119 "type": StringType,
120 "desc": "The name of the index to use",
121 },
122 "if_seq_no": {
123 "type": IntOrNothingType,
124 "desc": "Only perform the operation if the document has this sequence number",
125 },
126 "if_primary_term": {
127 "type": IntOrNothingType,
128 "desc": "Only perform the operation if the document has this primary term",
129 },
130 "op_type": {
131 "type": StringOrNothingType,
132 "desc": "Set to create to only index the document if it does not already exist (put if absent). If a "
133 "document with the specified `_id` already exists, the indexing operation will fail. Same as "
134 "using the `<index>/_create` endpoint. Valid values: `index`, `create`. If document id is "
135 "specified, it defaults to `index`. Otherwise, it defaults to `create`",
136 },
137 "pipeline": {
138 "type": StringOrNothingType,
139 "desc": "ID of the pipeline to use to preprocess incoming documents. If the index has a default "
140 "ingest pipeline specified, then setting the value to _none disables the default ingest pipeline "
141 "for this request. If a final pipeline is configured it will always run, regardless of the value "
142 "of this parameter",
143 },
144 "refresh": {
145 "type": StringOrNothingType,
146 "desc": "If `true` (default: `false`), Elasticsearch refreshes the affected shards to make this operation visible to "
147 "search, if `wait_for` then wait for a refresh to make this operation visible to search, if "
148 "`false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`",
149 },
150 "routing": {
151 "type": StringOrNothingType,
152 "desc": "Custom value used to route operations to a specific shard",
153 },
154 "timeout": {
155 "type": StringOrNothingType,
156 "desc": "Period to wait for a response (default: `1m`). If no response is received before the "
157 "timeout expires, the request fails and returns an error",
158 },
159 "version": {
160 "type": IntOrNothingType,
161 "desc": "Explicit version number for concurrency control. The specified version must match the "
162 "current version of the document for the request to succeed",
163 },
164 "version_type": {
165 "type": StringOrNothingType,
166 "desc": "Specific version type: `external`, `external_gte`",
167 },
168 "wait_for_active_shards": {
169 "type": StringOrNothingType,
170 "desc": "The number of shard copies that must be active before proceeding with the operation "
171 "(default `1`). Set to `all` or any positive integer up to the total number of shards in the "
172 "index (number_of_replicas+1)",
173 },
174 "require_alias": {
175 "type": SoftBoolStringType,
176 "desc": "If `true` (default `false`), the destination must be an index alias",
177 },
178 };
179
180public:
181
184
185};
186
189
190public:
191protected:
193 const Fields = {
194 "total": {
195 "type": IntType,
196 "desc": "Indicates how many shard copies (primary and replica shards) the index operation should be "
197 "executed on",
198 },
199 "successful": {
200 "type": IntType,
201 "desc": "Indicates the number of shard copies the index operation succeeded on. When the index "
202 "operation is successful, `successful` is at least 1.\n\n"
203 "Replica shards might not all be started when an indexing operation returns successfully; ​by "
204 "default, only the primary is required. Set `wait_for_active_shards` to change this default "
205 "behavior",
206 },
207 "failed": {
208 "type": IntType,
209 "desc": "An array that contains replication-related errors in the case an index operation failed on "
210 "a replica shard. `0` indicates there were no failures.",
211 },
212 };
213
214public:
215
218
219};
220
223
224public:
225protected:
227 const Fields = {
228 "_index": {
229 "type": StringType,
230 "desc": "The name of the index the document was added to",
231 },
232 "_id": {
233 "type": StringType,
234 "desc": "The unique identifier for the added document",
235 },
236 "_version": {
237 "type": IntType,
238 "desc": "The document version. Incremented each time the document is updated",
239 },
240 "result": {
241 "type": StringType,
242 "desc": "The result of the indexing operation, `created` or `updated`",
243 },
244 "_shards": {
246 "desc": "Provides information about the replication process of the index operation",
247 },
248 "_seq_no": {
249 "type": IntType,
250 "desc": "The sequence number assigned to the document for the indexing operation. Sequence numbers "
251 "are used to ensure an older version of a document doesn’t overwrite a newer version",
252 },
253 "_primary_term": {
254 "type": IntType,
255 "desc": "The primary term assigned to the document for the indexing operation",
256 },
257 "_type": {
258 "type": StringOrNothingType,
259 "desc": "The document type. Elasticsearch indices now support a single document type, `_doc`"
260 },
261 };
262
263public:
264
267
268};
269};
const ConstructorOptions
Constructor options.
Definition: ElasticSearchDataProvider.qc.dox.h:64
The ElasticSearch document create API data provider.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:32
auto doRequestImpl(auto req, *hash< auto > request_options)
Makes a request and returns the response.
*string getDesc()
Returns the data provider description.
const ResponseType
Response type.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:56
constructor(RestClient::RestClient rest)
Creates the object from a REST connection.
const RequestType
Request type.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:53
const QueryArgs
Query args.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:59
*DataProvider::AbstractDataProviderType getRequestTypeImpl()
Returns the description of a successful request message, if any.
hash< DataProvider::DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
const ProviderInfo
Provider info.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:39
RestClient::RestClient rest
REST client connection.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:36
*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: ElasticSearchDocumentCreateDataProvider.qc.dox.h:48
Create document request data type.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:111
const Fields
Field descriptions.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:116
Document create API response.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:222
const Fields
Field descriptions.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:227
Shard data type.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:188
const Fields
Field descriptions.
Definition: ElasticSearchDocumentCreateDataProvider.qc.dox.h:193
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:134