From a90b0056cc5a306b8cd39304b1801b8b9a742f53 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 7 Sep 2023 12:53:41 +0200 Subject: [PATCH] Fix `#hashtag` matching on individual components in search (#26835) --- app/lib/search_query_transformer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/search_query_transformer.rb b/app/lib/search_query_transformer.rb index 2dc10830d4..870f34cae8 100644 --- a/app/lib/search_query_transformer.rb +++ b/app/lib/search_query_transformer.rb @@ -121,7 +121,7 @@ class SearchQueryTransformer < Parslet::Transform def to_query if @term.start_with?('#') - { match: { tags: { query: @term } } } + { match: { tags: { query: @term, operator: 'and' } } } else { multi_match: { type: 'most_fields', query: @term, fields: ['text', 'text.stemmed'], operator: 'and' } } end