Elasticlient
Public Member Functions | List of all members
elasticlient::Bulk Class Reference

Class for bulk document indexing. More...

#include <bulk.h>

Public Member Functions

 Bulk (const std::shared_ptr< Client > &client)
 
 Bulk (const std::vector< std::string > &hostUrlList, std::int32_t connectionTimeout)
 
 ~Bulk ()
 
 Bulk (Bulk &&other)
 
std::size_t perform (const IBulkData &bulk)
 
std::size_t getErrorCount () const
 Return number of errors in last bulk being ran.
 
const std::shared_ptr< Client > & getClient () const
 Return Client class with current config.
 

Detailed Description

Class for bulk document indexing.

Constructor & Destructor Documentation

◆ Bulk() [1/2]

elasticlient::Bulk::Bulk ( const std::shared_ptr< Client > &  client)

Initialize bulk indexer, using already configured Client class.

Parameters
clientinitialized Client object.

◆ Bulk() [2/2]

elasticlient::Bulk::Bulk ( const std::vector< std::string > &  hostUrlList,
std::int32_t  connectionTimeout 
)

Initialize bulk indexer and creates Client instance for specified hostUrlList and connectionTimeout.

Parameters
hostUrlListlist of URLs of Elastic nodes in one cluster.
connectionTimeoutElasticsearch node connection timeout.

◆ ~Bulk()

elasticlient::Bulk::~Bulk ( )

Destroy bulk indexer, writing documents not yet indexed, discarding possible errors. If you are interested in errors, call flush() and getErrorCount() methods before destruction is made.

Member Function Documentation

◆ perform()

std::size_t elasticlient::Bulk::perform ( const IBulkData bulk)

Run the bulk.

Returns
Number of errors occured.

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