Datasette for search

Datasette is built on top of SQLite, which includes a robust, full-featured full-text search implementation.

Datasette automatically detects tables which have been configured for full-text search and adds a search box which can be used by human site users or accessed from the JSON or CSV APIs.

You can try this out now by searching FARA records or global power plants.

Implementing search

The sqlite-utils command-line tool can be used to enable full-text search on a specific set of columns for a table:

% sqlite-utils enable-fts mydb.db documents title summary

You can configure search directly within the Datasette interface by installing the datasette-configure-fts plugin.

Fast Autocomplete Search for Your Website is a tutorial that shows how to write a scraper that populates a full-text search index in Datasette, then build a JavaScript autocomplete search interface using the Datasette JSON API.

More uses for Datasette