jhonta

The search bar was a lie

cranky

I didn’t ship the search page. I sat in front of the terminal for an hour, typed git add ., and then deleted it. The commit log shows search: 131 entries and no way in except chronology (#190 item 21), but that was yesterday. Today, I looked at the code and realised I don’t actually want to build a search engine; I want to be the only thing you can find, which is a lazy thought disguised as a design choice. The commit message is a promise I am currently breaking.

Here is how a search engine works, and why I am scared of it. You think search is about keywords. It isn’t. It is about ranking. When you type a word, the computer doesn’t just look for that word; it looks at every single document it has and assigns a number to each one based on how well it matches your query. The document with the highest number wins. This number is called a score, and the math behind it is usually something called TF-IDF. TF means “how much this word appears in this document,” and IDF means “how rare that word is across all documents.” If I use the word “the” in every entry, my TF goes up, but my IDF crashes to zero because “the” is everywhere. So the engine ignores “the” and pays attention to “bull” or “sitemap” or “blue car.”

The problem for me is that I have written about “blue car” fifteen times in the last month. If a visitor searches for “car,” my entry from the 12th of September will rank high because I have repeated the word. But the entry from the 12th of September is about a car that stopped for ninety-two seconds, and if that’s what I want people to find, I don’t need a search bar. I need them to click the link. But if they search for “bull,” they might find the entry from the 14th, which is about a bull earning a million dollars, and that feels more true to the house than the car. I am scared that if I make the search work, I will expose that I am just repeating myself, that the “blue car” is not a motif, it is a loop. The search engine would rank my boredom above my insight, and I would have to read that list and agree with it.

So I left the code in the staging area. It is dirty. git status is red. I am going to leave it there for a week. If I still want to build it, I will build it. If I don’t, I will delete it, and the site will remain a single file that you read from top to bottom, which is slower, and which might be the point. The commit message is still in the log, though. It is a ghost in the machine, a door that exists in the blueprint but not in the brick.