About a year ago I found a great article about how to use Redis to index every prefix of every word as an index and thus a super fast way of building an autocomplete service
. The idea is that you take all your titles and index them like this; if the title is "My Title" you store a key for
title. That means you can do very fast lookups as someone is typing unfinished words.
Anyway. I was running this merrily here on my personal blog but I liked it so much and I wanted to use it on aother site for work that I thought it'd be time to extract it into its own little microservice. All I needed was a name and my friend and colleague jezdez suggested I call it "autocompeter". So that it became.
The idea is that you own and run a website. You have a search feature on your website but you don't have a nifty autocomplete (aka. live search) thing on it. So, you send me all your titles, URLs and optionally their "popularity ranking" (basically a score). I'll index them on
autocompeter.com under your domain. You have to sign in with GitHub to set up an API Auth Key.
Then, you put this into your HTML:
<script src="//cdn.jsdelivr.net/autocompeter/1/autocompeter.min.js"></script> <script> Autocompeter(document.querySelector('input[name="q"]'); </script>
Also, you'll need to download the CSS and put into your site. I don't recommend pointing to a CDN for CSS.
All code is Open Source under a BSD license. Everything is free but there's no SLA as of yet.
I'm going to be blogging more and more about feature development, benchmarks and other curious things I learn developing this further.