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

Filter Queries have an OR relationship rather than AND relationship #4630

Open
saharshkhicha18 opened this issue Feb 10, 2025 · 3 comments
Open
Assignees

Comments

@saharshkhicha18
Copy link
Contributor

Problem description

If we have 2 or more filter blocks configured under the source block. Then we call the source block endpoint with the query added for the filters (/blocks?Block_1=1200&Block_9=1). One filter is for Block_1 and one filter is for Block_9

I populated values with { 1, 100 }, { 12, 1200 } which then created 2 documents and then executed '/blocks?Block_1=1200&Block_9=1'. I expected an empty collection as a result because both these documents cannot pass through if both filters are selected, but got two items meaning that filters were executed as OR and not AND. Can this behavior be overridden?

Step to reproduce

Steps to reproduce the behavior:

  1. Add 2 filters to the policy workflow
Image
  1. Create 2 submissions
Image
  1. Select both the filters
Image

Here it shows both the documents instead of showing none as it should only show documents that applies to both the filters.

Expected behavior

In case of both filters being selected it should return the documents that pass through both the filters.

@Pyatakov
Copy link
Collaborator

Hey @saharshkhicha18, we tried to reproduce the issue on the current main and develop branches, but we couldn't - everything works as expected for us.
I've attached the policy that we used for our tests: two-filters-test.zip. Please try it and let us know If it's still the case. If yes, could you let us know what's the Guardian version that you're using?

Please find the video that we captured, showing the current behavior:
Image

@saharshkhicha18
Copy link
Contributor Author

@Pyatakov I have tried this policy as well and I have the same issue. The guardian version for my build seems to not be visible in the settings but I believe it is v3.0.

@prernaadev01
Copy link
Collaborator

@saharshkhicha18 Thank you so much for the ticket. We tested this issue and we have fixed this one in our latest Guardian release version: 3.1. So, we would request you to upgrade Guardian to latest one.

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