
Auto Complete with Redis (2010) - setra
http://oldblog.antirez.com/post/autocomplete-with-redis.html
======
antirez
Hello! This article is serverely stale info. Modern versions of Redis with
lexicographic ranges can do much better. Please check the following:
[https://redis.io/topics/indexes](https://redis.io/topics/indexes)

Also you may want to check the RediSearch module from Redis Labs. It's AGPL
and not part of the Redis project itself but it's very powerful.
[http://redisearch.io](http://redisearch.io)

BTW using vanilla Redis with lexicographic ranges some time ago I published a
demo where I indexed the whole Linux kernel code using a small amount of
memory and performing many tens of thousands ranges per second. There are
other systems out there that are designed just for search but in certain low
latency cases Redis can be hard to beat, also if you want to change the index
in real time.

~~~
jasode
_> This article is serverely stale info. Modern versions of Redis with
lexicographic ranges can do much better. Please check the following:
[https://redis.io/topics/indexes](https://redis.io/topics/indexes) _

Are you able to put a similar warning at the top of the article? Maybe
something like, "[The following info is deprecated but is left for historical
purposes. ... Please check the following:
[https://redis.io/topics/indexes]"](https://redis.io/topics/indexes\]")

~~~
antirez
You are right, I usually always do that but this time I totally missed this.
Thanks I'll do.

------
rubyn00bie
While i deeply love redis and have used this exact article in the past to
build an autocomplete— I’d really not recommend it to anyone. Using something
like elastic search provides much better and robust results.

Yes it’s more work to setup but the maintenance and tweaking will be waaaay
easier and more timely in the long run.

~~~
notimetorelax
IDK, having survived many ... MANY ES outages, I’d take REDIS in a heartbeat
if it gives me the functionality I need.

~~~
fernandotakai
it's amazing how every single person i know that used ES has had a freakton of
bad experiences with ES. and it's still the only ok solution in this area.

~~~
hadsed
What about Solr?

------
zachrose
Is this not a perfect use case for a trie? Can you make a trie in Redis?

~~~
yeswecatan
I have not implemented a trie myself, but apparently the problem is they take
up a lot of space: [http://www.drdobbs.com/database/ternary-search-
trees/1844105...](http://www.drdobbs.com/database/ternary-search-
trees/184410528)

~~~
dvirsky
A trie and a ternary search tree are two very different beasts. Tries can are
very memory efficient, as common prefixes in terms are bunched together, and
nodes are not split on every letter.

------
wickedlogic
The good news, it more popular now than before... sigh.
[https://hn.algolia.com/?query=Auto%20Complete%20with%20Redis...](https://hn.algolia.com/?query=Auto%20Complete%20with%20Redis&sort=byDate&dateRange=all&type=story&storyText=false&prefix&page=0)

------
diegorbaquero
Can we please put [2010] in the title?

------
stablemap
I’m glad to learn of this, but note that it’s from 2010.

~~~
maerF0x0
OP should put 2010 in the title.

------
keerthivar
actually good idea

