3 ms·
Initially LogsQL used the '-' char as 'NOT' shortcut. But lately we decided replacing it with '!' char, since the '-' is frequently used in full-text search phr
by valyala 3y ago
Initially LogsQL used the '-' char as 'NOT' shortcut. But lately we decided replacing it with '!' char, since the '-' is frequently used in full-text search phrases and/or field names. For example: 'some-field:some-value'. This could bring more confusion to LogsQL. So we decided to use '!' char as 'NOT' shortcut, since it occurs less frequently than '-' in typical qieries.
- mdaniel 3y agoI mean, it's your QL so you can do as you see fit but surely `_msg:alpha-beta` didn't previously parse as `{"_msg":["alpha", "NOT", "beta"]}` and nor would I expect `alpha-beta:charlie` to split in such a non-whitespace way I guess it boils down to whether LogsQL seeks to separate itself from similar solutions, in which case doing abnormal syntax is great, because there's no "uncanny search syntax valley" to be found, or whether it seeks to ease transition from existing search syntaxes in which case every deviation is one more "oh, right" to keep in one's head while transitioning between the systems - https://lucene.apache.org/core/9_6_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#NOT https://lucene.apache.org/core/9_6_0/queryparser/org/apache/... - https://support.google.com/websearch/answer/2466433 https://support.google.com/websearch/answer/2466433 - https://slack.com/help/articles/202528808-Search-in-Slack#narrow-your-search-with-modifiers-pre-ia https://slack.com/help/articles/202528808-Search-in-Slack#na... likely a bunch more. OTOH, maybe this is sampling bias since I'm sure there are syntaxes out there which use bang negation, too, I just haven't used them as much
- valyala 3y agoFair reasoning. We need to think more about using the '-' instead of '!' in LogsQL. On the other hand, the '!' char is used in almost every programming language as 'NOT' operator. Probably, this is my professional bias.