X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2666c3b726d190511f072db9e6606a1a99936968..d7a5e6e37e9e9251177f9fad98d867f477e69537:/services/api/lib/record_filters.rb diff --git a/services/api/lib/record_filters.rb b/services/api/lib/record_filters.rb index 831e357b42..c8f024291c 100644 --- a/services/api/lib/record_filters.rb +++ b/services/api/lib/record_filters.rb @@ -44,6 +44,14 @@ module RecordFilters cond_out = [] + if attrs_in == 'any' && (operator.casecmp('ilike').zero? || operator.casecmp('like').zero?) && (operand.is_a? String) && operand.match('^[%].*[%]$') + # Trigram index search + cond_out << model_class.full_text_trgm + " #{operator} ?" + param_out << operand + # Skip the generic per-column operator loop below + attrs = [] + end + if operator == '@@' # Full-text search if attrs_in != 'any'