Tipue Search
When I decided to move to a static (well, generated) html page for my personal website I read a lot of material on pelican, the tool I use to produce/render this site. So I also read about various possibilities to make the content searchable. Since I try to keep all traffic on this website local (if you find any resource being pulled from a third party server, please get in touch!), I was more interested in techniques that follow this directive rather than using one of the big search engines to index the content here.
It took me a while (for various reasons that are not worth being explained here) to finally implement Tipue Search here, but it’s done now! You can read all about it on their website, but I will give you a short primer here.
Upon building of the site, Tipue Search generates a JSON object for the entire content of the page. This object is later stored on the web server along with the rest of the page. When you type something in the search window (see above) and hit enter, a piece of javascript basically searches the JSON object(s) and generates the output. Voilá, your search results are done. This works amazingly fast (and in the words of the developers also works fast for 10s of thousands of pages) and there’s no need to send a request to a third party site and wait for the results. I think that’s really great!
Tipue Search integrates very well with pelican (there is a Tipue Search plugin available at github) and is also relatively easy to hack into an existing theme. All I had to do is adjust the base.html template and add a search.html template that displays the results.