AJAX Call with Elasticsearch Search
You can have a look here: https://github.com/dadoonet/devoxxfr_demo/blob/gh-pages/index.html#L512
It could help you to solve your issue.
Instead of writing your AJAX call, I'd suggest you use this tool called Postman. Postman has a simple motto -
Making API development easy
So in case you have trouble writing your ES requests, or maybe you decide not to use jQuery AJAX/XHR, and maybe you'd like to use cURL/Unirest/NSURL and what not, you can just use the Postman request builder to write down your simple Http Request, then you'll find a link called code in the box right below that, and you can generate requests in the language of your choice using that. Including AJAX, yes. So I'd recommend you try using that.
Here's the link where you can download Postman from - https://www.getpostman.com/postman