SDK
SDK C++ v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

This SDK has been deprecated because of stability issues. It is not advised to use it in a production environment.

getAutoRefresh #

The getAutoRefresh action returns the current autorefresh status for the index.

Each index has an autorefresh flag. When set to true, each write request trigger a refresh action on Elasticsearch. Without a refresh after a write request, the documents may not be immediately visible in search.

A refresh operation comes with some performance costs.
While forcing the autoRefresh can be convenient on a development or test environment, we recommend that you avoid using it in production or at least carefully monitor its implications before using it.

Signature #

bool getAutoRefresh(const std::string& index);

bool getAutoRefresh(const std::string& index, const kuzzleio::query_options& options);

Arguments #

ArgumentsTypeDescription
index
const std::string&
Index name
options
kuzzleio::query_options*
Query options

options #

Additional query options

OptionType
(default)
Description
queuable
bool

(true)
If true, queues the request during downtime, until connected to Kuzzle again

Return #

A boolean indicating the status of the autoRefresh flag.

Exceptions #

Throws a kuzzleio::KuzzleException if there is an error. See how to handle error.

Usage #

try {
  bool autorefresh_flag = kuzzle->index->getAutoRefresh("nyc-open-data");
  if (autorefresh_flag) {
    std::cout << "Autorefresh is enabled" << std::endl;
  } else {
    std::cerr << "Autorefresh is disabled" << std::endl;
  }
} catch (kuzzleio::KuzzleException &e) {
  std::cerr << e.what() << std::endl;
}