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 {