Skip to main content

Search Matchers

Search Matchers

List of all possible predicates

PredicateDescriptionNotes
*_eqequal
*_not_eqnot equal
*_matchesmatches with LIKEe.g. q[email_matches]=%@gmail.com
*_does_not_matchdoes not match with LIKE
*_matches_anyMatches any
*_matches_allMatches all
*_does_not_match_anyDoes not match any
*_does_not_match_allDoes not match all
*_ltless than
*_lteqless than or equal
*_gtgreater than
*_gteqgreater than or equal
*_presentnot null and not emptyOnly compatible with string columns. Example: q[name_present]=1 (SQL: col is not null AND col != '')
*_blankis null or empty.(SQL: col is null OR col = '')
*_nullis null
*_not_nullis not null
*_inmatch any values in arraye.g. q[name_in][]=Alice&q[name_in][]=Bob
*_not_inmatch none of values in array
*_lt_anyLess than anySQL: col < value1 OR col < value2
*_lteq_anyLess than or equal to any
*_gt_anyGreater than any
*_gteq_anyGreater than or equal to any
*_lt_allLess than allSQL: col < value1 AND col < value2
*_lteq_allLess than or equal to all
*_gt_allGreater than all
*_gteq_allGreater than or equal to all
*_not_eq_allnone of values in a set
*_startStarts withSQL: col LIKE 'value%'
*_not_startDoes not start with
*_start_anyStarts with any of
*_start_allStarts with all of
*_not_start_anyDoes not start with any of
*_not_start_allDoes not start with all of
*_endEnds withSQL: col LIKE '%value'
*_not_endDoes not end with
*_end_anyEnds with any of
*_end_allEnds with all of
*_not_end_any
*_not_end_all
*_contContains valueuses LIKE
*_cont_anyContains any of
*_cont_allContains all of
*_not_contDoes not contain
*_not_cont_anyDoes not contain any of
*_not_cont_allDoes not contain all of
*_i_contContains value with case insensitiveuses ILIKE
*_i_cont_anyContains any of values with case insensitive
*_i_cont_allContains all of values with case insensitive
*_not_i_contDoes not contain with case insensitive
*_not_i_cont_anyDoes not contain any of values with case insensitive
*_not_i_cont_allDoes not contain all of values with case insensitive
*_trueis true
*_falseis false

See full list: https://github.com/activerecord-hackery/ransack/blob/main/lib/ransack/locale/en.yml#L16