mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
fix search
This commit is contained in:
1 parent
c18e263f34
commit
4626518c83
2 files changed
+4
-2
No files matched your search
@@ -236,10 +236,12 @@ module SearchEntries
|
||||
end
|
||||
|
||||
def add_hyphens(entry, text)
|
||||
text = text.tr('\\', ' ')
|
||||
|
||||
hyphens = text.scan(/\b[^\s]*?\d-[^\s]+?\b/) + text.scan(/\b[^\s]+-\d[^\s]*?\b/)
|
||||
|
||||
hyphens.uniq.each_with_index do |item, index|
|
||||
entry.tsvector += " '#{item.delete("'\\")}':#{index + 1}" unless entry.tsvector.include?(item)
|
||||
entry.tsvector += " '#{item.delete("'")}':#{index + 1}" unless entry.tsvector.include?(item)
|
||||
end
|
||||
|
||||
entry
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ module Submitters
|
||||
end
|
||||
|
||||
def fulltext_search_field(current_user, submitters, keyword, field_name)
|
||||
keyword = keyword.delete("\0\\")
|
||||
keyword = keyword.delete("\0").tr('\\', ' ').squish
|
||||
|
||||
return submitters.none if keyword.blank?
|
||||
|
||||
|
||||
Reference in new issue
Block a user