Elasticlient
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
elasticlient::Scroll Class Reference

Class for use of Elasticsearch Scroll API. More...

#include <scroll.h>

Inheritance diagram for elasticlient::Scroll:
Inheritance graph
[legend]

Public Member Functions

 Scroll (const std::shared_ptr< Client > &client, std::size_t scrollSize=100, const std::string &scrollTimeout="1m")
 
 Scroll (const std::vector< std::string > &hostUrlList, std::size_t scrollSize=100, const std::string &scrollTimeout="1m", std::int32_t connectionTimeout=6000)
 
 Scroll (Scroll &&)
 
void clear ()
 Clear scroll for next usage. Should be called immediately after last next() was called.
 
void init (const std::string &indexName, const std::string &docType, const std::string &searchBody)
 
bool next (Json::Value &parsedResult)
 
const std::shared_ptr< Client > & getClient () const
 Return Client class with current config.
 

Protected Member Functions

virtual bool createScroll (Json::Value &parsedResult)
 Creates new scroll - obtain scrollId and parsedResult.
 

Protected Attributes

std::unique_ptr< Implementation > impl
 Hidden implementation and data holder.
 

Detailed Description

Class for use of Elasticsearch Scroll API.

Constructor & Destructor Documentation

◆ Scroll() [1/2]

elasticlient::Scroll::Scroll ( const std::shared_ptr< Client > &  client,
std::size_t  scrollSize = 100,
const std::string &  scrollTimeout = "1m" 
)
explicit

Initialize class for usage of Elasticsearch scroll API.

Parameters
clientinitialized Client object.
scrollSizenumber of results per one scroll "page".
scrollTimeouttime during scroll search context remaining alive. Defined by Elastic Time Units (i.e. 1m = 1 minute).

◆ Scroll() [2/2]

elasticlient::Scroll::Scroll ( const std::vector< std::string > &  hostUrlList,
std::size_t  scrollSize = 100,
const std::string &  scrollTimeout = "1m",
std::int32_t  connectionTimeout = 6000 
)
explicit

Initialize class for usage of Elasticsearch scroll API and create Client instance for specified hostUrlList and timeout.

Parameters
hostUrlListlist of URLs of Elastic nodes in one cluster.
scrollSizenumber of results per one scroll "page".
scrollTimeouttime during scroll search context remaining alive. Defined by Elastic Time Units (i.e. 1m = 1 minute).
timeoutElasticsearch node connection timeout.

Member Function Documentation

◆ init()

void elasticlient::Scroll::init ( const std::string &  indexName,
const std::string &  docType,
const std::string &  searchBody 
)

Initialize new Scroll search.

Parameters
indexNamespecification of an Elasticsearch index.
docTypespecification of an Elasticsearch document type.
searchBodyElasticsearch query body.

◆ next()

bool elasticlient::Scroll::next ( Json::Value &  parsedResult)

Scroll next (get next bulk of results) and parse it into parsedResult.

Returns
true if okay
false on error

The documentation for this class was generated from the following file: