Skip to content

Instantly share code, notes, and snippets.

@clintongormley
Created May 20, 2011 16:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save clintongormley/a90fc626d4f849b41100 to your computer and use it in GitHub Desktop.
EXISTING OPERATORS
------------------
Equals:
{ key => value }
Equals one of:
{ key => \@values }
{ key => {'==' => \@values }
Not equals:
{ key => { '!=' => value }}
{ key => { '<>' => value }}
None of:
{ key => { '!=' => \@values }}
{ key => { '<>' => \@values }}
Numeric range:
{ key => { '>|>=|<|<=' => value }}
String range:
{ key => { 'gt|gte|lt|lte' => value }}
PROPOSED OPERATORS
------------------
Prefix, ie starts with:
possibilities: * or ^ or ...
{ key => { '*' => value }}
{ key => { '^' => value }}
{ key => { '...' => value }}
Wildcard, ie shell wildcards ? *
possibilities: ** or *?
{ key => { '**' => 'f?o*'}}
{ key => { '*?' => 'f?o*'}}
Fuzzy, ie Levensthein distance:
proposed: *~
{ key => { '*~' => 'f?o*'}}
Text, ie full text search, eg "foo bar"
proposed: ~
{ key => { '~' => value }}
Query string, ie full text search with special query syntax
eg 'foo AND bar AND "this phrase" town:(london OR paris)'
proposed: ~~
{ key => { '~~' => value }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment