getAutoRefresh

// Using callbacks (node.js or browser)
kuzzle.getAutoRefresh('myIndex', function (err, autoRefresh) {
  console.log(autoRefresh);     // true|false
});

// Using promises (node.js)
kuzzle
  .getAutoRefreshPromise('myIndex')
  .then(autoRefresh => {
    console.log(autoRefresh);   // true|false
  });
kuzzle.getAutoRefresh("myIndex", new ResponseListener<Boolean>() {
  @Override
  public void onSuccess(Boolean autoRefresh) {
    // autoRefresh var contains the autoRefresh status of myIndex.
  }

  @Override
  public void onError(JSONObject error) {
    // Handle error
  }
}
<?php
use \Kuzzle\Kuzzle;

$kuzzle = new Kuzzle('localhost');
$result = $kuzzle->getAutoRefresh('myIndex');

// $result = true | false

The autoRefresh flag, when set to true, will make Kuzzle perform a refresh request immediately after each write request, causing documents to be immediately visible in a search.

The getAutoRefresh function returns the current autoRefresh status for the given index.


getAutoRefresh([index], [options], callback)

Arguments Type Description
index string Optional index to query. If no set, defaults to Kuzzle.defaultIndex
options JSON object Optional parameters
callback function Callback handling the response

Options

Option Type Description Default
queuable boolean Make this request queuable or not true

Callback Response

Returns a boolean with the index autoRefresh status.