SDK
SDK Javascript v6.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

getAutoRefresh #

This action returns the current autorefresh status of a index.

Each index has an autorefresh flag. When set to true, each write request triggers a refresh action in Elasticsearch. Without a refresh after a write request, the documents may not be immediately visible in search.

A refresh operation comes with some performance costs. While forcing the autoRefresh can be convenient on a development or test environment, we recommend that you avoid using it in production or at least carefully monitor its implications before using it.


getAutoRefresh(index, [options]);

ArgumentsTypeDescription
index
string
Index name
options
object
Query options

options #

Additional query options

PropertyType
(default)
Description
queuable
boolean

(true)
If true, queues the request during downtime, until connected to Kuzzle again

Resolves #

Resolves to a boolean that indicate the status of the autoRefresh flag.

Usage #

try {
  const status = await kuzzle.index.getAutoRefresh('nyc-open-data');
  console.log(`autorefresh is ${status}`);
} catch (error) {
  console.error(error.message);
}