SDK
SDK Golang 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(index, autorefresh, [options]) #

The setAutoRefresh action allows to set the autorefresh flag for the index.

Each index has an autorefresh flag.
When set to true, each write request trigger a refresh action on 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.

Arguments #

SetAutoRefresh(index string, autoRefresh bool, options types.QueryOptions) error
ArgumentsTypeDescription
index
string
Index name
autoRefresh
Boolean
autoRefresh flag
options
QueryOptions
Query options

Options #

Additional query options

OptionTypeDescriptionDefault
queuable
bool
Make this request queuable or nottrue

Return #

Return an error or nil.

Usage #

err := kuzzle.Index.SetAutoRefresh("nyc-open-data", true, nil)
if err != nil {
  log.Fatal(err)
} else {
  fmt.Println("autorefresh flag is set to true")
}