

Redis on steroids: Autocomplete using Redis, Nginx and Lua - alagu
http://www.cucumbertown.com/craft/autocomplete-using-redis-nginx-lua/

======
cliveowen
This implementation is too naive. You can't just autocomplete queries, you
have to accept typos and errors and suggest the correct query. That's the hard
part.

------
taf2
This is great need to figure out a good way to do request verification maybe
to ensure the request it properly signed.

Update: this looks like a good article describing a verification scheme
[http://www.stavros.io/posts/writing-an-nginx-
authentication-...](http://www.stavros.io/posts/writing-an-nginx-
authentication-module-in-lua/)

------
leorocky
The usual implementation for autocomplete is to generate a trie data
structure. A naive implementation will not have auto-correction or fix
problems more established implementations have already addressed.

~~~
guiomie
I'm currently implementing my own trie (for learning) for my own autocomplete
module ... and I don't see how a trie (prefix tree) can solve the issues you
just wrote.

~~~
mholt
When you traverse the prefix tree and you are blocked: meaning, the prefix
does not match an entry in the structure, you perform edit operations: insert,
delete, transpose, and substitute. If one of those garners a match, you keep
going down the tree until you reach your edit distance.

------
bithive123
I love Redis, nginx, and Lua and wrote my own autocomplete implementation
using Metaphone (e.g.
[https://github.com/threedaymonk/text](https://github.com/threedaymonk/text))
but after a while it became clear that what I really wanted was an instance of
Solr.

------
muxxa
I wonder if replacing nginx+lua with [http://webd.is/](http://webd.is/) would
be faster (and maybe easier to deploy)?

~~~
jzawodn
Could be.

We build something similar using node.js and it's working quite well. Perhaps
we can open source that someday...

