Skip to content

bigdata-eqxiu/elasticsearch-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 

Repository files navigation

Note:

I did not have a chance to work on JavaScript client for ES for some time now, thus this code can be outdated a bit. Hopefully, I will get back to it soon (still contributions are welcome, although I have a plan to rework current code base significantly).

ElasticSearch Javascript Client

Implementation of Javascript client for Elastic Search supporting jQuery (this is still work in progress).
All Node related stuff has been moved to a new offspring project node.es

Javascript client

The following is a simple example:


    <html>
    <head>
        <title>ElasticSearch-js: simple example</title>
        <script type="text/javascript" src="libs/jquery-1.4.3.min.js"></script>
        <script type="text/javascript" src="libs/json2.js"></script>
        <script type="text/javascript" src="../js/elasticsearch.js"></script>
        <script type="text/javascript" src="../js/elasticsearch-jquery.js"></script>
    </head>
    <body>

        <form>
            Show
            <input value="cluster state" id="state" type="button">,
            <input value="cluster health" id="health" type="button">,
            <input value="cluster nodes info" id="nodes_info" type="button">
        </form>

        <div id="output" style="white-space: pre; font-family: monospace;"></div>

        <script type="text/javascript">

            var displayJSON = function(data, xhr){ $("#output").empty().append(JSON.stringify(data, null, '  ')); };

            var es = new ElasticSearch({callback: displayJSON}); // by default connecting to localhost:9200

            $("#state").click(function(){ es.adminClusterState() });
            $("#health").click(function(){ es.adminClusterHealth({level: "shards"}) });
            $("#nodes_info").click(function(){ es.adminClusterNodeInfo() });

        </script>
    </body>
    </html>

Source code of this example can be found here: simple.html.

For more examples check demo folder.

About

ElasticSearch Javascript client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%