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

OR conditions are implemented as AND #19

Closed
fruel opened this issue May 14, 2018 · 7 comments
Closed

OR conditions are implemented as AND #19

fruel opened this issue May 14, 2018 · 7 comments

Comments

@fruel
Copy link

fruel commented May 14, 2018

(I think this is the issue @davidnmbond mentioned in #8 )

In SieveModel.cs where the filter expression is parsed only more AND-conditions are added to the list of filter items.

I think the issue happened because of a typo in the unit test here. I assume the value for Title should be "D" not "3" - then the test fails as expected.

@Biarity
Copy link
Owner

Biarity commented May 14, 2018

Yup, just realised this doesn't actually do any OR logic. I'll be rewriting the parser in a proper framework ASAP. Sorry about that!

@davidnmbond
Copy link

Confirmed - the unit test is wrong - changing the term was stated means that unit tests (correctly) fail.
Looking into a fix now...

davidnmbond added a commit to davidnmbond/Sieve that referenced this issue May 14, 2018
Biarity added a commit that referenced this issue May 25, 2018
@Biarity
Copy link
Owner

Biarity commented May 25, 2018

Published to nuget as 2.1.0. Thanks for your efforts!

@Biarity Biarity closed this as completed May 25, 2018
@davidnmbond
Copy link

No problem - I'm looking forward to seeing/helping Sieve develop further. If you need a hand, please add me as a contributor.

@Biarity
Copy link
Owner

Biarity commented May 25, 2018

That would be great! Looking at open issues - I was going to rewrite the parser next in something like Sparche to add flexibility and allow escape sequences, arbitrary logic, & data shaping. Of course that necessitates a more flexible way of converting the query to LINQ, meaning part of SieveProcessor.ApplyFiltering would also need to be rewritten.

@AlexandreBonfim
Copy link

Yup, just realised this doesn't actually do any OR logic. I'll be rewriting the parser in a proper framework ASAP. Sorry about that!

@Biarity How can I use OR logic? For example filters=Name@=*test,location@=*malta ...

Thanks, your library save a lot of time! :)

@Biarity
Copy link
Owner

Biarity commented Oct 1, 2018

I'll be working on this later but unfortunately am quite busy at the moment.

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

No branches or pull requests

4 participants