SDK
SDK Javascript v5.x
1

getAutoRefresh #

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.

A refresh operation comes with some performance costs.

While forcing the autoRefresh can be convenient on a development or test environmnent, we recommend that you avoid using it in production or at least carefully monitor its implications before using it.


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.

Usage #

Copied to clipboard!
// 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
  });