Re:What Postgres Full Text Search Is Missing
by packetlost on Tuesday August 06, 2024 @03:59PM
(#41174677)
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.
[ Parent
| on HN ]
Re:What Postgres Full Text Search Is Missing
by simonw on Tuesday August 06, 2024 @04:08PM
(#41174783)
I'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#...
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#configu... sqlite-utils enable-fts news.db articles headline body
sqlite-utils search news.db articles softball
Re:What Postgres Full Text Search Is Missing
by packetlost on Tuesday August 06, 2024 @04:31PM
(#41175001)
That's cool, maybe I can use it as a reference. Thank you!