Completed draft of arelastic for building es queries