Qore ElasticSearchDataProvider Module Reference 1.0
Loading...
Searching...
No Matches
ElasticSearchDataProvider::ElasticSearchRecordIterator Class Reference

Defines the record iterator class for Table-based iterators. More...

#include <ElasticSearchRecordIterator.qc.dox.h>

Inheritance diagram for ElasticSearchDataProvider::ElasticSearchRecordIterator:
[legend]

Public Member Functions

 constructor (RestClient::RestClient rest, string name, hash< auto > index, hash< string, DataProvider::AbstractDataField > record_type, *hash< auto > where_cond, *hash< auto > search_options)
 creates the iterator
 
*hash< string, DataProvider::AbstractDataFieldgetRecordType ()
 Returns the record description, if available.
 
hash< auto > getValue ()
 Returns a single record if the iterator is valid.
 
*hash< auto > makeQuery (*hash< auto > where_cond, *hash< auto > search_options)
 Returns the query body.
 
auto memberGate (string key)
 Returns the value of the given field in the current row, if the iterator is valid.
 
bool next ()
 Increments the row pointer when retrieving rows from a select statement.
 
bool valid ()
 Returns True if the iterator is valid.
 

Private Attributes

Qore::ListHashIterator i
 record iterator
 
hash< auto > index
 Index hash.
 
const MatchOptions = ("operator",)
 Query match options.
 
string name
 current index name
 
hash< string, DataProvider::AbstractDataFieldrecord_type
 The record type for the object.
 
RestClient::RestClient rest
 The REST client object for API calls.
 

Detailed Description

Defines the record iterator class for Table-based iterators.

Member Function Documentation

◆ constructor()

ElasticSearchDataProvider::ElasticSearchRecordIterator::constructor ( RestClient::RestClient  rest,
string  name,
hash< auto >  index,
hash< string, DataProvider::AbstractDataField record_type,
*hash< auto >  where_cond,
*hash< auto >  search_options 
)

creates the iterator

Parameters
restthe REST client connection
namethe name of the index
indexthe index definition hash
record_typerecord type information
where_condthe where clause for the query, if any
search_optionssearch options; assumed to have already been processed for validity before this call

◆ getRecordType()

*hash< string, DataProvider::AbstractDataField > ElasticSearchDataProvider::ElasticSearchRecordIterator::getRecordType ( )

Returns the record description, if available.

Returns
the record type of the iterator

◆ getValue()

hash< auto > ElasticSearchDataProvider::ElasticSearchRecordIterator::getValue ( )
virtual

Returns a single record if the iterator is valid.

Exceptions
INVALID-ITERATORthe iterator is not pointing at a valid element

Implements DataProvider::AbstractDataProviderRecordIterator.

◆ memberGate()

auto ElasticSearchDataProvider::ElasticSearchRecordIterator::memberGate ( string  key)

Returns the value of the given field in the current row, if the iterator is valid.

Parameters
keythe name of the field
Returns
the value of the given field in the current row, if the iterator is valid
Exceptions
FIELD-ERRORinvalid or unknown field name

◆ next()

bool ElasticSearchDataProvider::ElasticSearchRecordIterator::next ( )

Increments the row pointer when retrieving rows from a select statement.

Returns
True if there is a row to retrieve, False if not (no more rows to be retrieved)
Note
Exceptions could be thrown by the DBI driver when the statement is executed; see the relevant DBI driver docs for more information

◆ valid()

bool ElasticSearchDataProvider::ElasticSearchRecordIterator::valid ( )

Returns True if the iterator is valid.

Returns
True if the iterator is valid