Using the JavaScript driver to run an elasticsearch query