QueryBuilder.add(BoolQueryBuilder) is undefined for the type


(javaSuperMaster) #1

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);

    }

(David Pilato) #2

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?


(javaSuperMaster) #3

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);

}

(David Pilato) #4

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.


(David Pilato) #5

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


(David Pilato) #6