han1
July 18, 2017, 2:20pm
1
What we are trying to do is to index a bunch of documents in batches i.e.
foreach (var batch in props.ChunkBy(100))
{
var result = await client.IndexManyAsync<Type>(batch, indexName);
}
We would like to STOP Elasticsearch REFRESHING the Index until we have finished indexing all the batches. Then enable and refresh the index.
How can we achieve this with the NEST library
Many thanks
forloop
(Russ Cam)
July 21, 2017, 8:24am
2
To disable the refresh interval
client.UpdateIndexSettings("index-name", u => u
.IndexSettings(i => i
.RefreshInterval("-1")
)
);
To enable the refresh interval again and set it to 1 second
client.UpdateIndexSettings("index-name", u => u
.IndexSettings(i => i
.RefreshInterval("1s")
)
);
Async variant of UpdateIndexSettingsAsync()
can also be used
han1
July 21, 2017, 10:14am
3
Thank you very much Russ,
Any idea on my other question as to can one find out which field in the
document matched the query.
Many thanks
system
(system)
Closed
August 18, 2017, 10:22am
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.