Master
(javaSuperMaster)
January 22, 2018, 10:39am
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);
}
dadoonet
(David Pilato)
January 22, 2018, 10:50am
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?
i want to migrate elastic search from 2.x to 6.x.
In this process created new indexed and loaded data from DB to ES 6.x but in service layer(java) facing some issue like below
orQueryBuilder.add(QueryBuilders.termQuery("middleSchoolInd", "true"))
orQueryBuilder is depreciated so can i use code like below
QueryBuilders.boolQuery().filter(QueryBuilders.termQuery("highSchoolInd", "true"));
Master
(javaSuperMaster)
January 22, 2018, 11:28am
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);
}
dadoonet
(David Pilato)
January 22, 2018, 11:40am
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.
dadoonet
(David Pilato)
January 22, 2018, 11:47am
5
As you asked as well in the other thread, let's keep the discussion there.