BoolQueryBuilder toString method verbosity

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

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