kuzzle.setAutoRefresh('myIndex', true);
kuzzle.setAutoRefresh("myIndex", true);
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, causing documents to be immediately visible in a search.

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

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

Argument Type Description
index string Optional The index to set the autoRefresh for. If not set, defaults to kuzzle.defaultIndex.
autoRefresh boolean The value to set for the autoRefresh setting.
options JSON object Optional parameters
callback function Optional Callback handling the response


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

Return Value

Returns the Kuzzle SDK object to allow chaining.

Callback Response

Returns a boolean with the new autoRefresh status.