Fix #hashtag
matching non-hashtagged posts in search (#26781)
This commit is contained in:
parent
a106c46478
commit
68b4e36c82
4 changed files with 44 additions and 12 deletions
|
@ -53,7 +53,11 @@ class SearchQueryTransformer < Parslet::Transform
|
|||
end
|
||||
|
||||
def to_query
|
||||
{ multi_match: { type: 'most_fields', query: @term, fields: ['text', 'text.stemmed'], operator: 'and' } }
|
||||
if @term.start_with?('#')
|
||||
{ match: { tags: { query: @term } } }
|
||||
else
|
||||
{ multi_match: { type: 'most_fields', query: @term, fields: ['text', 'text.stemmed'], operator: 'and' } }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue