Elytra Blog

The simple RSS Reader. This blog publishes release notes, engineering and design details.

Strings, search and sanity.

Searching for content and matching it in lists in most such apps is trivially done by checking if your search input matches the title of an article or similar. This is great. It has worked for many years. However, the method naively skips out on a lot of information already available to the app. For example

  • Author’s name (when there are multiple people authoring on a website)
  • Date of publication (and matches to words like “Today”, “Yesterday” and the like)
  • Summaries

All of the above may contain information you could be searching for. Being stuck with trying to remember the name of the article you read last Sunday and finding it now is a b****. I’ve been in this position many times myself. Yes, bookmarking can save your bacon. But that method has a big single point of failure: what if you forgot to bookmark it? 

An well produced app should save you from this situation. It should save me from this situation. Depending on your current device, you may or not be able to see the tags on this post. I’ve included Levenshtein in there. If you’ve ever heard of Levenshtein distance, you’ll be familiar with how it works. If you haven’t, it’s simply a “score” of how similar or dissimilar two pieces of text are. 

Levenshtein distance is also calculated and matched against the title and summary to provide a loosely typed searching experience. So you simply need to know the “general” direction of where you’re going, and not the precise location. 

You may think this is a lot for a simple text-based search operation. It isn’t. I wonder why many haven’t already done something like this.