Skip to content
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

Badly formatted filter expression on AggreagtionSet #438

Closed
VitaliiBushylo opened this issue Feb 26, 2024 · 2 comments · Fixed by #439
Closed

Badly formatted filter expression on AggreagtionSet #438

VitaliiBushylo opened this issue Feb 26, 2024 · 2 comments · Fixed by #439

Comments

@VitaliiBushylo
Copy link

VitaliiBushylo commented Feb 26, 2024

The issue.
Getting error when I specify several operands in Filter for AggreagtionSet.

JSON model used for the test.

[Document(StorageType = StorageType.Json, Prefixes = new[] { nameof(UserForTest) })]
public class UserForTest
{
    [Indexed(Sortable = true, Aggregatable = true)]
    public string FirstName { get; set; }

    [Indexed(Sortable = true, Aggregatable = true)]
    public string LastName { get; set; }
}

The query.

var aggregationSet = provider.AggregationSet<UserForTest>();
var result = aggregationSet.Filter(m => m.RecordShell.FirstName == "John" && m.RecordShell.LastName == "Doe").ToList();

Getting Exception.

System.Exception: Missing (or badly formatted) value for expr->pred.right
Failed on FT.AGGREGATE userfortest-idx * FILTER @FirstName == 'John' && @LastName == Doe
 ---> StackExchange.Redis.RedisServerException: Missing (or badly formatted) value for expr->pred.right

The correctly formatted command is working though.
image

Please clarify am I doing something wrong here?
Thank you!

@slorello89 slorello89 linked a pull request Feb 27, 2024 that will close this issue
@slorello89
Copy link
Member

The expression parser was losing context that it was in a filter expression when it was building the operand string fro the right side of the expression. Opened #439 to address.

@VitaliiBushylo
Copy link
Author

The expression parser was losing context that it was in a filter expression when it was building the operand string fro the right side of the expression. Opened #439 to address.

Thank you @slorello89 for quick feedback. Looking forward for the fix release.

slorello89 added a commit that referenced this issue Apr 12, 2024
passing filter format down
slorello89 added a commit that referenced this issue Jun 6, 2024
passing filter format down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants