Simplify elasticsearch query