-
-
Notifications
You must be signed in to change notification settings - Fork 716
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
Handle field names with any characters with a known set of special #1109
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1109 +/- ##
==========================================
+ Coverage 89.57% 89.59% +0.02%
==========================================
Files 202 202
Lines 20198 20210 +12
==========================================
+ Hits 18092 18108 +16
+ Misses 2106 2102 -4
Continue to review full report at Codecov.
|
Ah nice the coverage report I added yesterday. Seems to be helpful, but not completely accurate. |
very nice indeed, would be nice to add it to quickwit. |
query-grammar/src/query_grammar.rs
Outdated
|
||
/// Parses a field_name | ||
/// A field name must have at least one character and be followed by a colon. | ||
/// All characters are allowed except special characters `SPECIAL_CHARS` |
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.
including special characters, but these needs to be escaped with escape character \
.
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 edited a comment and simplified the code a tiny bit)
…aracters and an escape one
…e character and does not start with `-` Closes #1087.
…characters and an escape one for the query parser.
Special characters :
+ ^ ` : { } " [ ] ( ) ~ ! \ * \s
.Almost like Lucene but without
&& || -
.The escape character is
\
.I kept the restriction on the
-
which cannot be a first character of a field name.-
can be considered as a special character as it is used by the language query, I did not put it in the special characters for retro compatibility.is_valid_field_name
function to check only if field name has at least one character and does not start with-