I have recently been unhappy with [DuckDuckGo’s](http://duckduckgo.com) indexing of my site. I considered changing back to a [Google](http://google.com) based search, but I figured there had to be something that let me have more control. I found my solution in a [Macdrifter post about self-hosted search](http://www.macdrifter.com/2012/08/self-hosted-search.html): [Sphider](http://www.sphider.eu/index.php). It is a php-based, self-hosted, search engine and it seems to work like a charm.
A couple of quick things that are not covered on Macdrifter:
* There’s an error in the SQL script you have to run to setup the database. Remove the “(14)” from the timestamp line for the creation of the query_log table near the end of the script [^fn1]
* If you want to edit the search box on a WordPress installation, you edit the “searchform.php” page in your theme directory[^fn2] My search form looks like this:
* If you do not edit the default template that comes with Sphider then people who get to your search results have no link back to the page they just came from[^fn3]. This bothers me from a usability perspective, so I added a couple of “Return to Previous Page” buttons to the “search_results.html” page.
Overall, the setup process, including the time it took me to style my search results, took me closer to two and a half hours, instead of one hour mentioned in the Macdrifter post. That said, I am really happy with the results.
[^fn1]: If you choose to use the “install.php” file instead of the SQL script, you have to make the same removal. In my version, it is on line 139.
[^fn2]: Or create that page if it does not exist.
[^fn3]: Other than the back button of course.