3 ms·
Very nice! FYI: sqlite ships with a full text search engine featuring a Boolean query language, highlight(), snippet() and scoring: https://www.sqlite.org/fts
by gorgoiler 3y ago
Very nice! FYI: sqlite ships with a full text search engine featuring a Boolean query language, highlight(), snippet() and scoring:
https://www.sqlite.org/fts5.html https://www.sqlite.org/fts5.html
I’ve not used it with enough content to know how much faster it is than LIKE ‘%my query%’ but it should be a lot quicker.
(Also, in most cases you don’t need to create an id column — every table has one already in the form of rowid.)
- Boltgolt 3y agoIn what cases is it unwise to rely on rowid over a id field?
- gorgoiler 3y agoI don’t think there are any. They are one and the same — if you create an integer primary key named id it is aliased to rowid: https://www.sqlite.org/rowidtable.html https://www.sqlite.org/rowidtable.html
- Scaevolus 3y agoThis is safer-- relying on implicit rowids can break things if you use a plaintext database dump (those don't have rowids), and having a column "id integer primary key" is clearer in the schema.
- eternauta3k 3y agoI think the integer autoincrement primary key is more explicit / less mysterious than the implicit rowid. Even if most of us have run into that explanation in the sqlite manual.
- lennxa 3y agoNot sure if this includes fuzzy search, but having it will make this much more usable.