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]);
Arguments | Type | Description |
---|---|---|
index | string | Index name |
options | object | Query options |
options #
Additional query options
Property | Type (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);
}