Merge pull request #7622 from rekonder/aj_SCI_10753

Espace special character for search [SCI-10753]
This commit is contained in:
ajugo 2024-06-04 10:47:29 +02:00 committed by GitHub
commit 85c1362903
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -203,7 +203,7 @@ module SearchableModel
new_phrase = exact_match ? phrase[1..-2] : phrase
if DATA_VECTOR_ATTRIBUTES.include?(attribute)
new_phrase = Regexp.escape(new_phrase.gsub(/[!()&|:]/, ' ').strip).split(/\s+/)
new_phrase = Regexp.escape(new_phrase.gsub(/[!()&|:<]/, ' ').strip).split(/\s+/)
new_phrase.map! { |t| "#{t}:*" } unless exact_match
new_phrase = new_phrase.join('&').tr('\'', '"')
else