-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
UI support for running FTS searches #131
Comments
simonw
added a commit
to simonw/csvs-to-sqlite
that referenced
this issue
Nov 19, 2017
The --fts option will create a corresponding SQLite FTS virtual table, using the best available version of the FTS module. https://sqlite.org/fts5.html https://www.sqlite.org/fts3.html Usage: csvs-to-sqlite my-csv.csv output.db -f column1 -f column2 Example generated with this option: https://sf-trees-search.now.sh/ Example search: https://sf-trees-search.now.sh/sf-trees-search-a899b92?sql=select+*+from+Street_Tree_List+where+rowid+in+%28select+rowid+from+Street_Tree_List_fts+where+Street_Tree_List_fts+match+%27grove+london+dpw%27%29%0D%0A Will be used in simonw/datasette#131
Relevant SQLite docs: |
Since SQLite supports column specifications in the MATCH body itself, there's no need to provide a separate mechanism for specifying columns in the query string: https://sqlite.org/fts5.html#fts5_column_filters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's an example query that searches all FTS indexed columns in a table: https://sf-trees-search.now.sh/sf-trees-search-a899b92?sql=select+*+from+Street_Tree_List+where+rowid+in+%28select+rowid+from+Street_Tree_List_fts+where+Street_Tree_List_fts+match+%27grove+london+dpw%27%29%0D%0A
And here's a query that searches a specific column: https://sf-trees-search.now.sh/sf-trees-search-a899b92?sql=select+*+from+Street_Tree_List+where+rowid+in+%28select+rowid+from+Street_Tree_List_fts+where+qSpecies+match+%27london%27%29%0D%0A
If we detect that a table has FTS enabled (which we can do by looking for it as a content table reference in another FTS table's create definition) we should add a search box to the table page which constructs this query - maybe using
?_search=XXX
in the query string?To support search against specified columns, we can do- not necessary, see comment below.?_search__ qSpecies=London
.?_search=
query string argumentThe text was updated successfully, but these errors were encountered: