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 operator #292

Open
shish opened this issue May 18, 2013 · 1 comment · May be fixed by #1092
Open

OR operator #292

shish opened this issue May 18, 2013 · 1 comment · May be fixed by #1092
Labels

Comments

@shish
Copy link
Owner

shish commented May 18, 2013

Can it be done without overloading the database?

@discomrade
Copy link
Contributor

I am currently testing a basic OR operator: ~tag1 ~tag2 tag3 matches posts with tag3 and either tag1 and/or tag2 . ~tag1 ~tag2 -tag3 matches posts with either tag1 and/or tag2 , except any with tag3. Order doesn't matter, there can be any number of OR operations. It does not work with parentheses.

It also handles negated OR: ~tag1 ~-tag2 ~-tag3 matches posts either with tag1 or which don't contain tag2 or which don't contain tag3 (so a post with tag2 tag4 will match because it doesn't have tag3, but a post with tag2 tag3 will not match)

While I do think OR with parentheses is much easier to use and powerful, they're too advanced for my current experience with parsing and SQL. This format is common enough (used on e621ng, legacy operator on danbooru, documented but 'not working' on safebooru, even though another Gelbooru 0.2 site has parentheses working)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants