# QueryBuilder.add(BoolQueryBuilder) is undefined for the type

**URL:** <https://discuss.elastic.co/t/querybuilder-add-boolquerybuilder-is-undefined-for-the-type/116469>\
**Category:** Elasticsearch\
**Created:** [January 22, 2018, 10:39am UTC](https://discuss.elastic.co/t/querybuilder-add-boolquerybuilder-is-undefined-for-the-type/116469 "2018-01-22T10:39:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 22, 2018, 10:50am UTC](https://discuss.elastic.co/t/querybuilder-add-boolquerybuilder-is-undefined-for-the-type/116469/2 "2018-01-22T10:50:43Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). 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?

> [@Elastic search depreciated classes](https://discuss.elastic.co/t/elastic-search-depreciated-classes/116232):
>
> 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"));

---

_[View the full topic](https://discuss.elastic.co/t/querybuilder-add-boolquerybuilder-is-undefined-for-the-type/116469)._
