SDK
SDK Java v2.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.

setAutoRefresh #

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.

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.


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

ArgumentTypeDescription
indexstringOptional The index to set the autoRefresh for. If not set, defaults to kuzzle.defaultIndex.
autoRefreshbooleanThe value to set for the autoRefresh setting.
optionsJSON objectOptional parameters
callbackfunctionOptional Callback handling the response

Options #

OptionTypeDescriptionDefault
queuablebooleanMake this request queuable or nottrue

Return Value #

Returns the Kuzzle SDK object to allow chaining.


Callback Response #

Returns a boolean with the new autoRefresh status.

Usage #

kuzzle.setAutoRefresh("myIndex", true);