Skip to content

BoolQuery hasClauses method #517

Closed
@ozcanyus

Description

@ozcanyus

Description

Hi!

As discussed here, we used to have hasClauses() method in BoolQueryBuilder class in the elastic client version 6.8.10 and we were using this method as part of our query building logic. But it is missing in the version 8.1.3.

We can still have the method in a newer version (8.1.3+) not in the builder since they are immutable, but in BoolQuery class.
That way we wouldn't have to do something like:

boolean hasClauses(BoolQuery boolQuery) {
        return !boolQuery.must().isEmpty()
            || !boolQuery.mustNot().isEmpty()
            || !boolQuery.should().isEmpty()
            || !boolQuery.filter().isEmpty();
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions