QueryBuilder.add(BoolQueryBuilder) is undefined for the type

Getting this error "The method add(BoolQueryBuilder) is undefined for the type QueryBuilder "

private void addAllSchoolFilters(QueryBuilder andQuery, SchoolSearchForm form) {
if (form.hasAgeFilter()) {
// actual code commented out
// OrQueryBuilder orQb = QueryBuilders.orQuery();
//modified code
BoolQueryBuilder orQb = QueryBuilders.boolQuery();
this.addSchoolAgeFilters(orQb, form);

//getting the above error here,please help

andQuery.add(orQb);

    }

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Or use markdown style like:

```
CODE
```

And it might be better to continue the discussion you started on the other thread?

Getting this error "The method add(BoolQueryBuilder) is undefined for the type QueryBuilder "

private void addAllSchoolFilters(QueryBuilder andQuery, SchoolSearchForm form) {
if (form.hasAgeFilter()) {
// actual code commented out
// OrQueryBuilder orQb = QueryBuilders.orQuery();
//modified code
BoolQueryBuilder orQb = QueryBuilders.boolQuery();
this.addSchoolAgeFilters(orQb, form);

//getting the above error here,please help

andQuery.add(orQb);

}

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Or use markdown style like:

```
CODE
```

Don't use citation icon but code icon if you are not using the markdown style. Thanks.

As you asked as well in the other thread, let's keep the discussion there.