diff --git a/_clients/javascript.md b/_clients/javascript.md index 42a00f67..f6490863 100644 --- a/_clients/javascript.md +++ b/_clients/javascript.md @@ -95,17 +95,13 @@ async function search() { var response = await client.index({ id: id, index: index_name, - body: document + body: document, + refresh: true }) console.log('Adding document:') console.log(response.body) - // Force an index refresh so the subsequent search returns results. - client.indices.refresh({ - index: index_name - }) - // Search for the document. var query = { 'query': {