In the days the news are about instant searches and auto complete, Salvatore Sanfilippo (@antirez) shows how to use Redis sorted sets and corresponding commands (
ZRANK) to implement autocompletion:
The initial code in Ruby:
already got ported to Python:
and ☞ Java and ☞ PHP.
As Ilya Grigorik (@igrigorik) commented, this is building a ☞ Trie with Redis.
Original title and link: Redis: Implementing Auto Complete or How to build Trie on Redis (NoSQL databases © myNoSQL)