I have adapted js to elasticsearch plugins