From 48c72fc0c1b24cab3c90f20b2ae427893dd3a395 Mon Sep 17 00:00:00 2001 From: keyan Date: Tue, 1 Feb 2022 16:27:10 -0600 Subject: [PATCH] rank exact search matches higher --- api/resolvers/item.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index 6a146329..e8fc67f4 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -279,6 +279,16 @@ export default { must: { bool: { should: [ + { + // all terms are matched in fields + multi_match: { + query, + type: 'most_fields', + fields: ['title^20', 'text'], + minimum_should_match: '100%', + boost: 3 + } + }, { // all terms are matched in fields multi_match: {