Conversation
- Add pre-processing to convert 'field in (val1, val2, ...)' syntax to OR expressions
- Add pre-processing to convert 'field:[val1, val2, ...]' bracket array syntax to OR expressions
- Add support for Liqe RangeExpression type (e.g., 'field:[min TO max]')
- Range expressions are converted to logical AND with >= and <= comparisons
- Exclusive ranges (field:{min TO max}) use > and < operators
- Add comprehensive tests for all new IN operator functionality
Fixes the bug where 'status in (todo, doing, done)' was being treated as a
full-text search instead of an IN operator expression.
|
Cursor Agent can help with this pull request. Just |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on March 18
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
…pattern Remove the 'field in (val1, val2, ...)' syntax in favor of the cleaner 'field:[val1, val2, ...]' bracket syntax. This keeps the query language consistent with the existing 'key:value' pattern used throughout QueryKit: - priority:>2 (comparison) - status:active (equality) - status:[todo, doing, done] (IN / multiple values) - id:[1 TO 10] (range) The bracket syntax is more intuitive for users since all operators follow the same 'key:' prefix pattern.
The convertToOrExpression method was using a simple split(',') to parse
values, which didn't respect quoted strings. A query like:
name:["John, Jr.", "Jane"]
Would incorrectly split at the internal comma, producing malformed output.
This fix adds a proper parseCommaSeparatedValues() method that:
- Tracks quote state (single and double quotes)
- Only splits on commas outside of quotes
- Handles escaped characters within quoted strings
- Preserves the original quoting for downstream processing
Added 3 new tests to validate:
- Double-quoted values with commas
- Single-quoted values with commas
- Mixed quoted and unquoted values with commas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for
INoperator syntax and LiqeRangeExpressionto the query parser to enhance query capabilities and fix parsing errors.The existing parser did not correctly handle
field in (val1, val2)orfield:[val1, val2]syntax, which are common patterns for checking if a field's value is within a set of values. Additionally, while Liqe itself supportsRangeExpression(e.g.,field:[min TO max]), the parser was not converting these into the appropriateANDcomparison expressions. This PR introduces a pre-processing step to convertINand array-like bracket syntax into Liqe-compatibleORexpressions and adds specific handling for Liqe'sRangeExpressiontype.Note
Medium Risk
Moderate risk because it changes core parsing/validation behavior via regex-based preprocessing and new AST conversion paths, which could affect edge-case query strings.
Overview
Adds support for set-membership and range syntax in the query parser.
QueryParser.parse/validatenow pre-process queries to acceptfield in (a, b, ...)andfield:[a, b, ...]by rewriting them into Liqe-compatible(field:a OR field:b ...)strings (with basic quoting/escaping).Also adds explicit handling for Liqe
RangeExpressionsofield:[min TO max]andfield:{min TO max}are converted intoAND-combined comparisons with inclusive/exclusive bounds. Tests are expanded to cover the newINsyntaxes, mixed expressions, case-insensitiveIN, quoted values, and range preservation.Written by Cursor Bugbot for commit cab3326. Configure here.