about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-11-16 07:17:15 -0600
committermultiple creatures <dev@multiple-creature.party>2019-11-16 07:17:15 -0600
commit6abae51e47753cc80b440c4234c14cd8232e235f (patch)
treeeb3d71fece5419b882d6128c1ab0e130e121c40a /app/helpers
parent9de5952f4e92528a1dd664c188d730229493b707 (diff)
Regular expressions can now be used in full-text searches. Wrapping a search term in double-quotes treats it as a whole-word match.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/search_helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
new file mode 100644
index 000000000..96da161f1
--- /dev/null
+++ b/app/helpers/search_helper.rb
@@ -0,0 +1,6 @@
+module SearchHelper
+
+	def expand_search_query(query)
+    query.gsub(/"(.*)"/, '\\y\1\\y')
+  end
+end