setAutoRefresh

kuzzle.setAutoRefresh('myIndex', true);
kuzzle.setAutoRefresh("myIndex", true);
<?php
use \Kuzzle\Kuzzle;

$kuzzle = new Kuzzle('localhost');

$kuzzle->setAutoRefresh('myIndex', true);

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.

Given an index, the setAutoRefresh function updates its autoRefresh status.


setAutoRefresh([index], autoRefresh, [options], [callback])

ArgumentTypeDescription
indexstringOptional The index to set the autoRefresh for. If not set, defaults to kuzzle.defaultIndex.
autoRefreshbooleanThe value to set for the autoRefresh setting.
optionsJSON objectOptional parameters
callbackfunctionOptional Callback handling the response

Options

OptionTypeDescriptionDefault
queuablebooleanMakr this request as (non)queuabletrue

Return value

Returns the Kuzzle object to allow chaining.


Callback response

The response is a boolean reflecting the new autoRefresh status.