mirror of
https://github.com/docusealco/docuseal
synced 2026-11-07 07:22: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
|
end
|
||||||
|
|
||||||
def add_hyphens(entry, text)
|
def add_hyphens(entry, text)
|
||||||
|
text = text.tr('\\', ' ')
|
||||||
|
|
||||||
hyphens = text.scan(/\b[^\s]*?\d-[^\s]+?\b/) + text.scan(/\b[^\s]+-\d[^\s]*?\b/)
|
hyphens = text.scan(/\b[^\s]*?\d-[^\s]+?\b/) + text.scan(/\b[^\s]+-\d[^\s]*?\b/)
|
||||||
|
|
||||||
hyphens.uniq.each_with_index do |item, index|
|
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
|
end
|
||||||
|
|
||||||
entry
|
entry
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ module Submitters
|
|||||||
end
|
end
|
||||||
|
|
||||||
def fulltext_search_field(current_user, submitters, keyword, field_name)
|
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?
|
return submitters.none if keyword.blank?
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user