Giter Club home page Giter Club logo

elasticsearch-js's Introduction

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.

elasticsearch-js's People

Contributors

lukas-vlcek avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.