Java - build query due to the many fields

I can't reproduce with that. Please read carefully About the Elasticsearch category. There is an example of what is a recreation script.
Here I can't just copy and paste and run.

BTW there is a typo here:

      ],