X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e8f99cfef7cfbfcf1a1485d69250f24ced3fd609..0f537bcaa60b8a1496010bc9d4a943484e69081c:/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'