From 7afa273f71b69dc5a993861be3edf6c023552bd2 Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 16 Nov 2022 16:29:51 +0100 Subject: [PATCH] Allow searching accross multiple fields (fixes #43) --- server/lib/elastic-search/shared/query-helpers.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/lib/elastic-search/shared/query-helpers.ts b/server/lib/elastic-search/shared/query-helpers.ts index 4aadb15..4b2cbb9 100644 --- a/server/lib/elastic-search/shared/query-helpers.ts +++ b/server/lib/elastic-search/shared/query-helpers.ts @@ -48,6 +48,15 @@ function buildMultiMatchBool (search: string, fieldsObject: { default: string[], minimum_should_match: ELASTIC_SEARCH_QUERY.MINIMUM_SHOULD_MATCH } }, + { + multi_match: { + query: search, + fields: fieldsObject.default, + operator: ELASTIC_SEARCH_QUERY.OPERATOR, + minimum_should_match: ELASTIC_SEARCH_QUERY.MINIMUM_SHOULD_MATCH, + type: "cross_fields" + } + }, { multi_match: { query: search,