[ARVADOS] created: d5bdc7be359a2780ef47186452054dfbe071237a
Git user
git at public.curoverse.com
Thu Aug 31 12:00:53 EDT 2017
at d5bdc7be359a2780ef47186452054dfbe071237a (commit)
commit d5bdc7be359a2780ef47186452054dfbe071237a
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Wed Aug 30 16:49:44 2017 -0400
12194: Use plainto_tsquery() for full-text search.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/services/api/lib/record_filters.rb b/services/api/lib/record_filters.rb
index eb8d09b..677c8f0 100644
--- a/services/api/lib/record_filters.rb
+++ b/services/api/lib/record_filters.rb
@@ -52,10 +52,9 @@ module RecordFilters
# Skip the generic per-column operator loop below
attrs = []
- # Use to_tsquery since plainto_tsquery does not support prefix
- # search. And, split operand and join the words with ' & '
- cond_out << model_class.full_text_tsvector+" @@ to_tsquery(?)"
- param_out << operand.split.join(' & ')
+ # plainto_tsquery() interprets "foo:bar baz" as "'foo:bar' & 'baz'".
+ cond_out << model_class.full_text_tsvector+" @@ plainto_tsquery(?)"
+ param_out << operand
end
attrs.each do |attr|
if !model_class.searchable_columns(operator).index attr.to_s
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list