1
0
mirror of https://github.com/mastodon/mastodon synced 2024-11-27 22:38:27 +09:00

Fix #hashtag matching on individual components in search (#26835)

This commit is contained in:
Eugen Rochko 2023-09-07 12:53:41 +02:00 committed by GitHub
parent 8a9d7aeb1e
commit a90b0056cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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