How to set more query to elasticsearch via java API

A bit old but you get the idea: Sorting response hits using java api