Skip to content

Conversation

floristenhove
Copy link
Contributor

This PR introduces a new isEmpty method in the BoolQuery class and adds tests. This is a convenience method that eases development when working with this package. In my experience, building a bool query can get quite complicated and sometimes ends up without any queries. This method provides an easy way to check this.

I've also added a test for the entire class, which did not exist yet.

Enhancements to BoolQuery functionality:

  • Added the isEmpty method to the BoolQuery class to check whether the query is empty by verifying that all query components (must, filter, should, and must_not) are empty.

@bram-pkg bram-pkg merged commit b20140a into spatie:main Jun 11, 2025
20 checks passed
@bram-pkg
Copy link
Collaborator

Thank you!

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.

2 participants