A simple, and real-time infix search with redis.
conn.index(1, "john@customer.io")
conn.index(2, "jrallison@gmail.com")
conn.index(3, "colin@customer.io")
conn.index(3, "someone@custom.com")
conn.search("custom") == [
{ id: 3, value: "colin@customer.io" },
{ id: 1, value: "john@customer.io" },
{ id: 4, value: "someone@custom.com" }
]
Results are ordered in the following order:
- Exact matches
- Prefix matches
- Lexicographical order
Note: currently very memory intensive. experimental. :)
TODO
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request