Transforming JSON to match Elasticsearch Query DSL

I am trying to process MongoDB queries that come in a JSON format that looks like that:

{ "$or": [ {"id":"string"},{"field":"string"} ] }

What do you think would be the best way to transform those queries to match the Elasticsearch Java API?