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

Problem: I cannot do complex OR clauses as I cannot use AND inside OR #566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

somdoron
Copy link

within search OR operation only allow one search key while the protocol allow multiple.
To solve this I added special operator called AND which is allow only within OR clause, the AND just allow unbound array which is inline into the OR operation.

Some examples, if I want to the following IMAP query I cannot do that before this PR:

OR (UNKEWORD DISCARD) (BEFORE 24-AUG-2016 UNSEEN)

trying to do the following yield error:
[['OR', [['UNKEYWORD', 'DISCARD'], [['BEFORE', '24-AUG-2016'], UNSEEN]]]

Now I can do:
[['OR', [['UNKEYWORD', 'DISCARD'], [['AND', ['BEFORE', '24-AUG-2016'], UNSEEN]]]]

which works

If you have another solution for the problem that will be great.

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 this pull request may close these issues.

1 participant