# BoolQueryBuilder toString method verbosity

**URL:** <https://discuss.elastic.co/t/boolquerybuilder-tostring-method-verbosity/147091>\
**Category:** Elasticsearch\
**Created:** [September 3, 2018, 2:21pm UTC](https://discuss.elastic.co/t/boolquerybuilder-tostring-method-verbosity/147091 "2018-09-03T14:21:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ltsallas](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@ltsallas](https://discuss.elastic.co/u/ltsallas)\
**Post date:** [September 3, 2018, 2:21pm UTC](https://discuss.elastic.co/t/boolquerybuilder-tostring-method-verbosity/147091/1 "2018-09-03T14:21:10Z")

</div>

Hi,  
I am in the middle of updating Elasticsearch from v2.4.5 to v5.6.10 in one of my Java projects.  
I have a series of unit tests that compared the JSON outcome of a BoolQueryBuilder.toString().

In the new version all the test sare broken because toString method is more verbose and prints out all the default query parameters. I know that both queries are valid, but can I somehow control this verbosity so that the outcome of toString method in v5 matches that of v2?

One simple example for a term query.

```
 "term" : {
        "endpoint" : "Alpha"
      }

```

now returns

```
 "term" : {
          "endpoint" : {
               "value" : "Alpha",
               "boost" : 1.0
           }
  }
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 1, 2018, 2:21pm UTC](https://discuss.elastic.co/t/boolquerybuilder-tostring-method-verbosity/147091/2 "2018-10-01T14:21:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
