-
-
Notifications
You must be signed in to change notification settings - Fork 718
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
?_searchmode=raw option for running FTS searches without escaping characters #676
Comments
I'm afraid this is by design: supporting wildcards in that mode was more-or-less accidental and often resulted in unexpected user-facing syntax errors when users accidentally entered search text that included characters with special meaning to SQLite. You can still execute wildcard searches but you have to do so using custom SQL statements. I'm open to suggestions for more friendly ways to support this functionality. Would an alternative |
Thanks Simon, |
I'm going to call it |
I could go with |
Nice thing about the "search mode" concept is that I can optionally reflect it in the HTML UI in some way - maybe with a checkbox for "raw" mode that only shows up if the user hits the page with It also hints at potentially adding further search modes in the future. Not sure if I'd do that but it's an interesting potential avenue to explore. |
You can try this right now like so:
Then use the following:
|
Still needs documentation before I can land it in master. |
Awesome, thank you so much. I’ll try it out and let you know.
…On Sun, Feb 23, 2020 at 1:44 PM Simon Willison ***@***.***> wrote:
You can try this right now like so:
pip install https://github.com/simonw/datasette/archive/search-raw.zip
Then use the following:
?_search=foo*&_searchmode=raw`
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#676?email_source=notifications&email_token=AN3FXEFS6B22U2NOT6M5FULRELNY7A5CNFSM4KYIOIB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMWGYTI#issuecomment-590113869>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN3FXEANDJ6AIHGU4ADK4D3RELNY7ANCNFSM4KYIOIBQ>
.
|
OK, this is in master now. You can install master using:
Documentation here: https://datasette.readthedocs.io/en/latest/json_api.html#special-table-arguments |
After the version 0.34. I am not able to use the wildchar in the _search option( or the full text search). It will not return any result unless I specify the whole word for text search.
If I use 'match :search || "*" ' in the sql statement then it will work as expected.
The text was updated successfully, but these errors were encountered: