Autocomplete with Redis
antirez.com
antirez.com
There's building a link farm, and then there's giving your article a descriptive title.
I actually think it's reassuring that there will always be a creative and unexpected title that titillates the brain in a way that search engine automation algorithm will never equate. By the way, that why most of the CMS systems allow for an alias used in SEO-type descriptors like search engine friendly URLs or meta titles.
If we leave search engines to choose for us the most creative, interesting, and talented content creators, we are in deep trouble I think. Until then, you can keep surfing randomly once-in-a-while and finding out how far Google is from guessing what's most interesting on any subject. Google and other search engine always tend to return lowest common denominator results on any subject, rather than a new creative and rare perspective on that same subject. It's the nature of automation for the masses.
Search automation such as an autocomplete is useful nevertheless. I also agree it can be vastly improved. Autocompletes are there to help you improve the quality of how you formulate your query, help you find content faster, and help you find related, misspelled, or otherwise relevant content. Here is a paper I wrote on advanced autocomplete features of which most have yet to be implemented by Google for instance: http://www.exorbyte.com/index.php/White-Papers/ajax-incremen...
Your title is now vastly better for everyone, from search engines to casual readers.
I too think it's a good idea in general btw. Don't want to defend my lame titles, but clearly there is a technical limit in our technology. An human will easily recognize that a given article is about something regardless of the title. Just hoping that in the future we'll be ok even with lame titles, but the right thing to do now is indeed switching to saner, descriptive titles.
I don't think we'll add such a command, nor that a more complex implementation is a good idea, because this algorithm is pretty straightforward and very fast, and can be modeled using the pre-existing API. Also in most completion systems you want to complete only frequent items, so I'm not sure if it's a memory bound problem in practice.
That said I expect the proposed solution to be able to deliver at least 10k completions per second in a small virtual machine.
Ran 10000 queries in 26.52s using bsearch
Ran 10000 queries in 3.87s using normalized method
the advantage in using the bsearch is that you have a clean data set, incase you use that set in other parts, and it is easier to manage the data.I think the normalized method is faster indeed but it's not possible to tell from this benchmark.