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@veritasgenetics.com>
//
// "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 + ':*'