-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Advanced query search syntax for multi byte search #7546
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
Advanced query search syntax for multi byte search #7546
Conversation
5c261f6
to
b82c389
Compare
Very nice. Do we also need to make a corresponding change to documentation? |
ba57e9c
to
e0cee56
Compare
I think this is too much information for a tooltip. For detailed information the information that open for "Number format" (under Edit Visualization) works nicely but that seems like overkill for this feature. |
Thank you for your feedback ! It may be a bit tricky as this feature is valid only when multi byte search is enabled. |
I don't have a better idea for this. We could add it as a hidden/undocumented feature, but that's not a good habit. |
I think this is the right way to go. To start we can add this hidden feature (no tooltip), just a source code comment, and update documentation later. |
This reverts commit 43148ba.
Thank you! So, at first, I just removed the tooltip for now. |
# - name:"multiple words" | ||
# - word1 word2 word3 | ||
# - word1 "multiple word" query:"select foo" | ||
tokens = re.findall(r'(?:([^:\s]+):)?(?:"([^"]+)"|(\S+))', term) |
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.
Is there a better way to break words and "multiple words" into tokens? This regex appears to work, may also contain hard-to-find edge cases
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.
Thank you for the review!
At first, the query string matches one of those.
- Qualifier:Keyword => (?:([^:\s]+):) AND (?:"([^"]+)"|(\S+))
- Keyword => (?:"([^"]+)"|(\S+))
And, the keyword matches one of those:
- "any characters" => "([^"]+)"
- NonSpaceCharacters => (\S+)
I think this covers the all 4 cases( 2 cases x 2 cases).
Or, we may implement simple tokenizer. That makes more flexible, but it need a bit of code.
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.
Or, we may implement simple tokenizer. That makes more flexible, but it need a bit of code.
The regex is very compact. We can refactor this in the future if we need more flexibility
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.
I see. Thank you !
And, I tried to create a PR for the documentation. |
What type of PR is this?
Description
Before the PR, when multi byte search is enabled, query search only support "ILIKE" based filtering. There is no way to search multiple terms, queries.
This PR make it possible to search query by specifying column name, exact match, multiple term AND search.
For example:
- word
- name:word
- query:word
- "multiple words"
- name:"multiple words"
- word1 word2 word3
- word1 "multiple word" query:"select foo"
How is this tested?