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

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

  public void onError(JSONObject error) {
    // Handle error
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, forcing the documents to be immediately visible to search.

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

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

indexstringOptional index to query. If no set, defaults to Kuzzle.defaultIndex
optionsJSON objectOptional parameters
callbackfunctionCallback handling the response


queuablebooleanMark this request as (not) queuabletrue

Callback response

The response is a boolean reflecting the index autoRefreshstatus.