Merge branch '12462-search-periods'
authorTom Clegg <tclegg@veritasgenetics.com>
Mon, 30 Oct 2017 13:19:36 +0000 (09:19 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Mon, 30 Oct 2017 13:19:36 +0000 (09:19 -0400)
refs #12462

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

apps/workbench/app/assets/javascripts/to_tsquery.js

index ab584d4be6682088b2c5d396dc2d28fe21b40006..34ccb6c2774d26fe7e85e701a0672e6df5ebacf3 100644 (file)
 //
 // "foo"     => "foo:*"
 // "foo/bar" => "foo:*&bar:*"
+// "foo.bar" => "foo.bar:*"    // "." is a word char in FT queries
 // "foo|bar" => "foo:*&bar:*"
 // " oo|ba " => "oo:*&ba:*"
 // "// "     => null
 // ""        => null
 // null      => null
 window.to_tsquery = function(q) {
-    q = (q || '').replace(/\W+/g, ' ').trim().replace(/ /g, ':*&')
+    q = (q || '').replace(/[^\w\.]+/g, ' ').trim().replace(/ /g, ':*&')
     if (q == '')
         return null
     return q + ':*'