Loading...
Searching...
No Matches
ElasticSearchIndexTableDataProvider.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
namespace ElasticSearchDataProvider {
class ElasticSearchIndexTableDataProvider : public ElasticSearchDataProviderBase {
public:
string name;
hash<auto> index;
const ProviderInfo = <DataProviderInfo>{
"desc": "ElasticSearch index table data provider; provdes table-like access to an ElasticSearch index; "
"fields returned in searches are document properties, plus the special `_id` (document ID) and "
"`_score` (query match score) values, which are read-only.\n\n"
"Updating and deleting can be performed, but the 'where clause hash` must contain only a single "
"`_id` key to identify the document by its ID.\n\n"
"Searches are performed with `match`; for more flexible searching, use the index search API data "
"provider, `index/search`",
"type": "ElasticSearchIndexTableDataProvider",
"constructor_options": ElasticSearchDataProvider::ConstructorOptions,
"has_record": True,
"supports_read": True,
"supports_native_search": True,
"supports_update": True,
"supports_delete": True,
"supports_create": True,
"create_options": {
"if_seq_no": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."int",
"desc": "Only perform the operation if the document has this sequence number",
},
"if_primary_term": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."int",
"desc": "Only perform the operation if the document has this primary term",
},
"op_type": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Set to create to only index the document if it does not already exist (put if absent). If a "
"document with the specified `_id` already exists, the indexing operation will fail. Same as "
"using the `<index>/_create` endpoint. Valid values: `index`, `create`. If document id is "
"specified, it defaults to `index`. Otherwise, it defaults to `create`",
},
"pipeline": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "ID of the pipeline to use to preprocess incoming documents. If the index has a default "
"ingest pipeline specified, then setting the value to _none disables the default ingest pipeline "
"for this request. If a final pipeline is configured it will always run, regardless of the value "
"of this parameter",
},
"refresh": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "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. Valid values: `true`, `false`, `wait_for`",
},
"routing": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Custom value used to route operations to a specific shard",
},
"timeout": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Period to wait for a response (ex: `1m`). If no response is received before the "
"timeout expires, the request fails and returns an error",
},
"version": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."int",
"desc": "Explicit version number for concurrency control. The specified version must match the "
"current version of the document for the request to succeed",
},
"version_type": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Specific version type: `external`, `external_gte`",
},
"wait_for_active_shards": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "The number of shard copies that must be active before proceeding with the operation. Set to "
"`all` or any positive integer up to the total number of shards in the index (number_of_replicas+1)",
},
"require_alias": <DataProviderOptionInfo>{
"type": SoftBoolDataProviderStringType,
"desc": "If `true`, the destination must be an index alias",
},
},
"search_options": {
"if_seq_no": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."int",
"desc": "Only perform the operation if the document has this sequence number\n"
"(update only)",
},
"if_primary_term": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."int",
"desc": "Only perform the operation if the document has this primary term\n"
"(update only)",
},
"lang": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "The script language\n"
"(update only)",
},
"operator": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Boolean logic used to interpret text in the query value. Valid values are:\n"
"- `or` (Default): For example, a query value of `capital of Hungary` is interpreted as "
"`capital OR of OR Hungary`\n"
"- `and`: For example, a query value of `capital of Hungary` is interpreted as "
"`capital AND of AND Hungary`\n"
"(search only)",
"allowed_values": (
<AllowedValueInfo>{
"value": "or",
"desc": "Or logic - any terms match (default)",
},
<AllowedValueInfo>{
"value": "and",
"desc": "And logic - all terms must match",
}
),
},
"require_alias": <DataProviderOptionInfo>{
"type": SoftBoolDataProviderStringType,
"desc": "If `true`, the destination must be an index alias\n"
"(update only)",
},
"refresh": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "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. Valid values: `true`, `false`, `wait_for`\n"
"(update only)",
},
"retry_on_conflict": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."int",
"desc": "Specify how many times should the operation be retried when a conflict occurs\n"
"(update only)",
},
"routing": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Custom value used to route operations to a specific shard\n"
"(update only)",
},
"_source": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Set to `false` to disable source retrieval (default: `true`). You can also specify a "
"comma-separated list of the fields you want to retrieve\n"
"(update only)",
},
"_source_excludes": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Specify the source fields you want to exclude\n"
"(update only)",
},
"_source_includes": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Specify the source fields you want to exclude\n"
"(update only)",
},
"timeout": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "Period to wait for a response (ex: `1m` = 1 minute). If no response is received before "
"the timeout expires, the request fails and returns an error",
},
"version": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "",
},
"wait_for_active_shards": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."string",
"desc": "The number of shard copies that must be active before proceeding with the operation. "
"Set to `all` or any positive integer up to the total number of shards in the index "
"(number_of_replicas+1)\n"
"(update only)",
},
},
};
const ProviderSummaryInfo = cast<hash<DataProviderSummaryInfo>>(ProviderInfo{
AbstractDataProvider::DataProviderSummaryInfoKeys
});
const TypeMap = {
"binary": AbstractDataProviderTypeMap."base64binary",
"boolean": AbstractDataProviderTypeMap."boolean",
"keyword": AbstractDataProviderTypeMap."string",
"constant_keyword": AbstractDataProviderTypeMap."string",
"wildcard": AbstractDataProviderTypeMap."string",
"ip": AbstractDataProviderTypeMap."string",
"version": AbstractDataProviderTypeMap."string",
"mumur3": AbstractDataProviderTypeMap."string",
"text": AbstractDataProviderTypeMap."string",
"match_only_text": AbstractDataProviderTypeMap."string",
"byte": AbstractDataProviderTypeMap."int",
"short": AbstractDataProviderTypeMap."int",
"integer": AbstractDataProviderTypeMap."int",
"long": AbstractDataProviderTypeMap."int",
"unsigned_long": AbstractDataProviderTypeMap."number",
"date": AbstractDataProviderTypeMap."date",
// NOTE: lossy conversion here; Qore only supports microsecond resolution
"date_nanos": AbstractDataProviderTypeMap."date",
"double": AbstractDataProviderTypeMap."float",
"float": AbstractDataProviderTypeMap."float",
"half_float": AbstractDataProviderTypeMap."float",
"scaled_float": AbstractDataProviderTypeMap."float",
"object": AbstractDataProviderTypeMap."hash",
"flattened": AbstractDataProviderTypeMap."hash",
"nested": AbstractDataProviderTypeMap."list",
};
const SearchQueryOptions = ("timeout",);
protected:
hash<string, AbstractDataField> record_type = {
"_id": new QoreDataField("_id", "the document ID", AbstractDataProviderTypeMap."softstring"),
"_score": new QoreDataField("_score", "the score for the match (read-only)",
AbstractDataProviderTypeMap."float"),
};
public:
constructor(RestClient::RestClient rest, string name, hash<auto> index) ;
string getName();
*string getDesc();
protected:
DataProvider::AbstractDataProviderRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
public:
protected:
int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
public:
protected:
int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
public:
protected:
*hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
public:
hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
DataProvider::AbstractDataProviderType getTypeForProperty(string name, hash<auto> prop);
static string getQueryOptions(string uri, hash<auto> search_options, list<string> query_args);
protected:
string getDocUriPath(string uri_str, *hash<auto> where_cond, string action, *hash<auto> search_options, *list<string> query_args);
public:
protected:
getRecordInfoIntern();
public:
protected:
*hash<string, DataProvider::AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
public:
};
};
DataProvider::AbstractDataProviderRecordIterator
DataProvider::AbstractDataProviderType
ElasticSearchDataProvider::ElasticSearchDataProviderBase
The AWS REST client base data provider class.
Definition: ElasticSearchDataProviderBase.qc.dox.h:28
ElasticSearchDataProvider::ElasticSearchDataProvider::ConstructorOptions
const ConstructorOptions
Constructor options.
Definition: ElasticSearchDataProvider.qc.dox.h:61
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider
This class exposes ElasticSearch indices as record-based data providers.
Definition: ElasticSearchIndexTableDataProvider.qc.dox.h:38
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::ProviderSummaryInfo
const ProviderSummaryInfo
Provider summary info.
Definition: ElasticSearchIndexTableDataProvider.qc.dox.h:214
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::ProviderInfo
const ProviderInfo
Provider info.
Definition: ElasticSearchIndexTableDataProvider.qc.dox.h:48
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::getQueryOptions
static string getQueryOptions(string uri, hash< auto > search_options, list< string > query_args)
Returns a URI path with query options.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::searchRecordsImpl
DataProvider::AbstractDataProviderRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::deleteRecordsImpl
int deleteRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::getTypeForProperty
DataProvider::AbstractDataProviderType getTypeForProperty(string name, hash< auto > prop)
Returns a data type for a property.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::SearchQueryOptions
const SearchQueryOptions
Search query options.
Definition: ElasticSearchIndexTableDataProvider.qc.dox.h:258
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::constructor
constructor(RestClient::RestClient rest, string name, hash< auto > index)
Creates the object from a REST connection.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::updateRecordsImpl
int updateRecordsImpl(hash< auto > set, *hash< auto > where_cond, *hash< auto > search_options)
Updates a single document in the index.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::getStaticInfoImpl
hash< DataProvider::DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::getName
string getName()
Returns the data provider name.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::index
hash< auto > index
Index hash.
Definition: ElasticSearchIndexTableDataProvider.qc.dox.h:45
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::record_type
hash< string, AbstractDataField > record_type
The record type for the object.
Definition: ElasticSearchIndexTableDataProvider.qc.dox.h:262
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::createRecordImpl
*hash< auto > createRecordImpl(hash< auto > rec, *hash< auto > create_options)
Writes the given record to the data provider.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::name
string name
Current index name.
Definition: ElasticSearchIndexTableDataProvider.qc.dox.h:42
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::getRecordInfoIntern
getRecordInfoIntern()
Retrieves the record type.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::getDesc
*string getDesc()
Returns the data provider description.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::getDocUriPath
string getDocUriPath(string uri_str, *hash< auto > where_cond, string action, *hash< auto > search_options, *list< string > query_args)
Makes sure that the where_cond is only the _id field.
ElasticSearchDataProvider::ElasticSearchIndexTableDataProvider::TypeMap
const TypeMap
ElasticSearch property types to data types.
Definition: ElasticSearchIndexTableDataProvider.qc.dox.h:219
RestClient::RestClient
ElasticSearchDataProvider
Qore ElasticSearchDataProvider module definition.
Definition: ElasticSearchAcknowledgedDataType.qc.dox.h:26
ElasticSearchDataProvider::SoftBoolDataProviderStringType
const SoftBoolDataProviderStringType
Boolean data provider string type for query parameters.
Definition: ElasticSearchDataProvider.qc.dox.h:138