Fun with sqlite/fts

A while ago I played with sqlite. Its pretty awesome. When using the full text search (fts) extension it also provides super fast full text searching. One of the things I was missing (compared to other engines) is the similar text suggestion (“Did you mean?”) support. Fortunately this is relatively easy to add via the fts4aux virtual table that sqlite supports.

I pushed a full example of to https://github.com/mvo5/sqlite-fts-did-you-mean. The way it works is that you build a set of similar words and use that to query for the “term” value from the fts4aux table.

Here is the output from the example:

$ ./fts_did_you_mean.py aptx
Did you mean:
 apex (rank: 2)
 apt (rank: 1)
time 0.024138927459716797

One Response to “Fun with sqlite/fts”

  1. Mike Vogt Says:

    We have the same name!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: