Fix: #370 ダブルクオートを使った日本語検索が効かない (#448)

* Fix: #370 ダブルクオートを使った日本語検索が効かない

* Add test for multiple words

* Improve test

* 入れ替え

* 単語検索のテスト
This commit is contained in:
KMY(雪あすか) 2024-01-12 10:27:35 +09:00 committed by GitHub
parent b044cbeb63
commit d864399a09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 4 deletions

View file

@ -237,7 +237,7 @@ class SearchQueryTransformer < Parslet::Transform
else
# Memo for checking when manually merge
# { multi_match: { type: 'most_fields', query: @term, fields: ['text', 'text.stemmed'], operator: 'and' } }
{ match_phrase: { text: { query: @term } } }
{ multi_match: { type: 'most_fields', query: @term, fields: ['text', 'text.stemmed'], operator: 'and' } }
end
end
end
@ -251,6 +251,8 @@ class SearchQueryTransformer < Parslet::Transform
end
def to_query
# Memo for checking when manually merge
# { match_phrase: { text: { query: @phrase } } }
{ match_phrase: { text: { query: @phrase } } }
end
end