Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tokenize option for FTS #130

Closed
simonw opened this issue Aug 1, 2020 · 3 comments
Closed

Support tokenize option for FTS #130

simonw opened this issue Aug 1, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Aug 1, 2020

FTS5 supports things like porter stemming using a tokenize= option:

https://www.sqlite.org/fts5.html#tokenizers

Something like this in code:

            CREATE VIRTUAL TABLE [{table}_fts] USING {fts_version} (
                {columns},
                tokenize='porter',
                content=[{table}]
            );

I tried this out just now and it worked exactly as expected.

So... db[table].enable_fts(...) should accept a 'tokenize= argument, and sqlite-utils enable-fts ... should support a --tokenize option.

@simonw
Copy link
Owner Author

simonw commented Aug 1, 2020

@simonw simonw changed the title Support tokenize option for FTS5 Support tokenize option for FTS Aug 1, 2020
@simonw
Copy link
Owner Author

simonw commented Aug 1, 2020

Turns out it works for FTS4 as well: https://www.sqlite.org/fts3.html#tokenizer

@simonw simonw closed this as completed in 57e4eb8 Aug 1, 2020
@simonw
Copy link
Owner Author

simonw commented Aug 1, 2020

simonw added a commit that referenced this issue Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant