3 ms·
I wish SQLite FTS had a nicer to use API. Last time I looked (a few months ago) it was very confusing and not very user friendly.
by packetlost 2y ago
I wish SQLite FTS had a nicer to use API. Last time I looked (a few months ago) it was very confusing and not very user friendly.
- simonw 2y agoI've built a bunch of Python (and CLI) code to try and help make that work better: https://sqlite-utils.datasette.io/en/stable/python-api.html#full-text-search https://sqlite-utils.datasette.io/en/stable/python-api.html#... import sqlite_utils db = sqlite_utils.Database("news.db") db["articles"].enable_fts(["headline", "body"]) results = list(db["articles"].search("softball")) Or with the CLI tool: https://sqlite-utils.datasette.io/en/stable/cli.html#configuring-full-text-search https://sqlite-utils.datasette.io/en/stable/cli.html#configu... sqlite-utils enable-fts news.db articles headline body sqlite-utils search news.db articles softball
- packetlost 2y agoThat's cool, maybe I can use it as a reference. Thank you!