Live data from Hacker News

SQLite FTS5 Extension

sqlite.org

11–20 of 61 posts

Re: SQLite FTS5 Extension

#11
Does anybody know how to make it work with UUID as primary keys? I got stuck on that a while back and it randomly corrupts when using rowid. Couldn't figure out a solution other than migrate my schema to use a sequential integer instead.

Re: SQLite FTS5 Extension

#12
post #3

This is hugely underrated in my opinion: it’s a very competent search engine. It also ships as part of the Python standard library, so if your machine has Python installed you have a high quality search engine ready to use without installing anything else. I have a CLI tool (and Python library) for working with it here: https://sqlite-utils.datasette.io/en/stable/cli.html#configu...

I have been using it as my only searching engine for my blog in years and it’s much better than anything else I’ve thrown at it. For bonus points, peewee ORM supports it directly.

Re: SQLite FTS5 Extension

#14
post #3

This is hugely underrated in my opinion: it’s a very competent search engine. It also ships as part of the Python standard library, so if your machine has Python installed you have a high quality search engine ready to use without installing anything else. I have a CLI tool (and Python library) for working with it here: https://sqlite-utils.datasette.io/en/stable/cli.html#configu...

though useless for many non english languages

Eh? The tokenizers are fully pluggable, the Unicode and ICU tokenizers will be good for many purposes and you can always drop something specific in.

Eg https://github.com/wangfenjin/simple

Re: SQLite FTS5 Extension

#15
Has anyone tried this out on mobile? I have a list of app ideas that all center around shipping a big database to a device and allowing complex querying while offline.

Re: SQLite FTS5 Extension

#16
post #9

Can you do fuzzy search with it?

Not by default, no. But you could kind of implement it by providing a custom tokenizer that emits multiple terms for the same position in the document, with different variants of the same token. This would not be "proper" fuzzy search, but might be enough depending on the use case.

See https://www.sqlite.org/fts5.html#synonym_support for more details on the different approaches for implementing synonyms in custom tokenizers.

Re: SQLite FTS5 Extension

#17
post #14

Earlier quoted context omitted.

though useless for many non english languages

Eh? The tokenizers are fully pluggable, the Unicode and ICU tokenizers will be good for many purposes and you can always drop something specific in. Eg https://github.com/wangfenjin/simple

I know it’s extensible, with original work. ICU isn’t helpful for some languages

Re: SQLite FTS5 Extension

#18
post #11

Does anybody know how to make it work with UUID as primary keys? I got stuck on that a while back and it randomly corrupts when using rowid. Couldn't figure out a solution other than migrate my schema to use a sequential integer instead.

Use an UNINDEXED column, see https://www.sqlite.org/fts5.html#the_unindexed_column_option

Re: SQLite FTS5 Extension

#20
post #16
post #9

Can you do fuzzy search with it?

Not by default, no. But you could kind of implement it by providing a custom tokenizer that emits multiple terms for the same position in the document, with different variants of the same token. This would not be "proper" fuzzy search, but might be enough depending on the use case. See https://www.sqlite.org/fts5.html#synonym_support for more details on the different approaches for implementing synonyms in custom tok…

I don't think that will work for me, since I needed something that can handle mistakes in the words, like Du'ha to duha etc, Rahman to rehman, basically whatever looks closest.
Post reply on HN