refreshIndex

kuzzle.refreshIndex('myIndex');
kuzzle.refreshIndex("myIndex");
<?php
use \Kuzzle\Kuzzle;

$kuzzle = new Kuzzle('localhost');

try {
  $kuzzle->refreshIndex('myIndex');
}
catch (ErrorException $e) {

}

When writing or deleting documents in Kuzzle's database layer, the update needs to be indexed before being reflected in the search index.
By default, this operation can take up to 1 second.

Given an index, the refresh action forces a refresh, on it, making the documents visible to search immediately.


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

ArgumentTypeDescription
indexstringOptional. The index to refresh. If not set, defaults to kuzzle.defaultIndex.
optionsJSON objectOptional parameters
callbackfunctionOptional. Callback handling the response.

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not)queuabletrue

Return value

Returns the Kuzzle object to allow chaining.


Callback response

The response is a JSON structure matching the response from Elasticsearch.