From 75eada0b074157631ae4b21745205be3cc067a92 Mon Sep 17 00:00:00 2001 From: Paul Beaudoin Date: Thu, 17 Oct 2024 15:42:37 -0400 Subject: [PATCH] Fix misleading es utils documentation --- lib/elasticsearch/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/elasticsearch/utils.js b/lib/elasticsearch/utils.js index 1a1abfbf..0861121f 100644 --- a/lib/elasticsearch/utils.js +++ b/lib/elasticsearch/utils.js @@ -79,7 +79,7 @@ const buildEsMatchClause = (matcher, field, value, boost) => { * `prefix` clause that can be inserted into a ES query. * * For example: -* const query = { prefixMatch('idIsbn', '1234' } +* const body = { query: prefixMatch('idIsbn', '1234' } */ const prefixMatch = (field, value, boost = 1) => { return buildEsMatchClause('prefix', field, value, boost) @@ -90,7 +90,7 @@ const prefixMatch = (field, value, boost = 1) => { * `term` clause that can be inserted into a ES query * * For example: -* const query = { termMatch('idBarcode', '1234567891011' } +* const body = { query: termMatch('idBarcode', '1234567891011' } */ const termMatch = (field, value, boost = 1) => { return buildEsMatchClause('term', field, value, boost) @@ -101,7 +101,7 @@ const termMatch = (field, value, boost = 1) => { * `match_phrase` clause that can be inserted into a ES query * * For example: -* const query = { phraseMatch('title', 'Importance of Being' } +* const body = { query: phraseMatch('title', 'Importance of Being' } */ const phraseMatch = (field, value, boost = 1) => { return {