-
Notifications
You must be signed in to change notification settings - Fork 7
feat: update fuzzy search regex and error handling #552
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
feat: update fuzzy search regex and error handling #552
Conversation
|
Thanks for the PR @Delicious-Bacon ! @donhardman please review. |
donhardman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like all good, but let's follow code style and fix CI issues.
You can run locally bin/codestyle and bin/codeanalyze to make sure ALL tests pass.
|
I ran the My |
donhardman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks a lot for your pull request and great work.
80fe1ad
into
manticoresoftware:fork/merge
* feat: update fuzzy search regex and error handling * ran codestyle, codeanalyze, test --------- Co-authored-by: Don Hardman <[email protected]>
This commit increases Buddy version in deps.txt to 3.35.0 Related PR manticoresoftware/manticoresearch-buddy#552 Related PR #3708
Problem
Currently the SQL parser errors when
fuzzy=1option is used with a defined table name (secondary option) like this:A query like that returns
The 'fuzzy' option requires a full-text query.This should be supported as per Searching > Full text matching > Basic usage#MATCH | Manticore Search Manual.
On the other hand, the docs also mention it's an optional instruction in the
MATCHclause (that it will default to the left table), but when I try to run the query without the table I gen an error messageno such table ''.Solution
Add an optional group match seeking table name in the regex pattern:
/MATCH\s*\(\'(.*?)\'(\s*,\s*\w*?)?\s*\)/ius.This is later also checked and passed to the returning
sprintfingetQueriesSQLRequest.Side notes
I have modified an ambiguous message
The 'fuzzy' option requires a full-text query.to provide details on what is needed in the queryUse: MATCH('search query') or MATCH('search query', table_name).I have added a check when table name in
MATCHis missing, but there is a comma (,) in the clause:Let me know if this seems OK.