[ARVADOS] created: 1.1.0-54-gec253d9
Git user
git at public.curoverse.com
Fri Oct 20 14:03:35 EDT 2017
at ec253d9fd7debdc035fd5fa0cf721c9f9d87115f (commit)
commit ec253d9fd7debdc035fd5fa0cf721c9f9d87115f
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Fri Oct 20 13:59:45 2017 -0400
12462: Fix full-text search for terms like "foo.bar".
A search for a filename like "foo.bar" should match text "foo.bar" --
but "foo.bar" was transformed to "foo:* & bar:*", and since "." is a
word character, "bar:*" did not match "foo.bar".
Now "foo.bar" is transformed to "foo.bar:*".
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/apps/workbench/app/assets/javascripts/to_tsquery.js b/apps/workbench/app/assets/javascripts/to_tsquery.js
index ab584d4..34ccb6c 100644
--- a/apps/workbench/app/assets/javascripts/to_tsquery.js
+++ b/apps/workbench/app/assets/javascripts/to_tsquery.js
@@ -11,13 +11,14 @@
//
// "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 + ':*'
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list