SDK C# v1.x

# SetAutoRefreshAsync

The setAutoRefresh action updates the autorefresh flag for the provided index.

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

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

Copied to clipboard!
Task SetAutoRefreshAsync(string index , boolean autoRefresh);
Argument Type Description
Index name
autoRefresh flag

# Usage

Copied to clipboard!
await kuzzle.Index.SetAutoRefreshAsync("nyc-open-data", true);
Console.WriteLine("autorefresh flag is set to true");