<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    ElasticSearch - An API for communicating with ElasticSearch

VERSION
    Version 0.59, tested against ElasticSearch server version 0.20.0.RC1.

DESCRIPTION
    ElasticSearch is an Open Source (Apache 2 license), distributed, RESTful
    Search Engine based on Lucene, and built for the cloud, with a JSON API.

    Check out its features: &lt;http://www.elasticsearch.org/&gt;

    This module is a thin API which makes it easy to communicate with an
    ElasticSearch cluster.

    It maintains a list of all servers/nodes in the ElasticSearch cluster,
    and spreads the load across these nodes in round-robin fashion. If the
    current active node disappears, then it attempts to connect to another
    node in the list.

    Forking a process triggers a server list refresh, and a new connection
    to a randomly chosen node in the list.

SYNOPSIS
        use ElasticSearch;
        my $es = ElasticSearch-&gt;new(
            servers      =&gt; 'search.foo.com:9200',  # default '127.0.0.1:9200'
            transport    =&gt; 'http'                  # default 'http'
                            | 'httplite'
                            | 'httptiny'
                            | 'curl'
                            | 'aehttp'
                            | 'aecurl'
                            | 'thrift',
            max_requests =&gt; 10_000,                 # default 10_000
            trace_calls  =&gt; 'log_file',
            no_refresh   =&gt; 0 | 1,
        );

        $es-&gt;index(
            index =&gt; 'twitter',
            type  =&gt; 'tweet',
            id    =&gt; 1,
            data  =&gt; {
                user        =&gt; 'kimchy',
                post_date   =&gt; '2009-11-15T14:12:12',
                message     =&gt; 'trying out Elastic Search'
            }
        );

        $data = $es-&gt;get(
            index =&gt; 'twitter',
            type  =&gt; 'tweet',
            id    =&gt; 1
        );

        # native elasticsearch query language
        $results = $es-&gt;search(
            index =&gt; 'twitter',
            type  =&gt; 'tweet',
            query =&gt; {
                text =&gt; { user =&gt; 'kimchy' }
            }
        );

        # ElasticSearch::SearchBuilder Perlish query language
        $results = $es-&gt;search(
            index  =&gt; 'twitter',
            type   =&gt; 'tweet',
            queryb =&gt; {
                message   =&gt; 'Perl API',
                user      =&gt; 'kimchy',
                post_date =&gt; {
                    '&gt;'   =&gt; '2010-01-01',
                    '&lt;='  =&gt; '2011-01-01',
                }
            }
        );


        $dodgy_qs = "foo AND AND bar";
        $results = $es-&gt;search(
            index =&gt; 'twitter',
            type  =&gt; 'tweet',
            query =&gt; {
                query_string =&gt; {
                    query =&gt; $es-&gt;query_parser-&gt;filter($dodgy_qs)
                },
            }
        );

    See the "examples/" directory for a simple working example.

GETTING ElasticSearch
    You can download the latest released version of ElasticSearch from
    &lt;http://www.elasticsearch.org/download/&gt;.

    See here for setup instructions:
    &lt;http://www.elasticsearch.org/tutorials/2010/07/01/setting-up-elasticsea
    rch.html&gt;

CALLING CONVENTIONS
    I've tried to follow the same terminology as used in the ElasticSearch
    docs when naming methods, so it should be easy to tie the two together.

    Some methods require a specific "index" and a specific "type", while
    others allow a list of indices or types, or allow you to specify all
    indices or types. I distinguish between them as follows:

       $es-&gt;method( index =&gt; multi, type =&gt; single, ...)

    "single" values must be a scalar, and are required parameters

          type  =&gt; 'tweet'

    "multi" values can be:

          index   =&gt; 'twitter'          # specific index
          index   =&gt; ['twitter','user'] # list of indices
          index   =&gt; undef              # (or not specified) = all indices

    "multi_req" values work like "multi" values, but at least one value is
    required, so:

          index   =&gt; 'twitter'          # specific index
          index   =&gt; ['twitter','user'] # list of indices
          index   =&gt; '_all'             # all indices

          index   =&gt; []                 # error
          index   =&gt; undef              # error

    Also, see "use_index()/use_type()".

  as_json
    If you pass "as_json =&gt; 1" to any request to the ElasticSearch server,
    it will return the raw UTF8-decoded JSON response, rather than a Perl
    datastructure.

RETURN VALUES AND EXCEPTIONS
    Methods that query the ElasticSearch cluster return the raw data
    structure that the cluster returns. This may change in the future, but
    as these data structures are still in flux, I thought it safer not to
    try to interpret.

    Anything that is known to be an error throws an exception, eg trying to
    delete a non-existent index.

INTEGRATION WITH ElasticSearch::SearchBuilder
    ElasticSearch::SearchBuilder provides a concise Perlish
    SQL::Abstract-style query language, which gets translated into the
    native Query DSL
    &lt;http://www.elasticsearch.org/guide/reference/query-dsl&gt; that
    ElasticSearch uses.

    For instance:

        {
            content =&gt; 'search keywords',
            -filter =&gt; {
                tags        =&gt; ['perl','ruby'],
                date        =&gt; {
                    '&gt;'     =&gt; '2010-01-01',
                    '&lt;='    =&gt; '2011-01-01'
                },
            }
        }

    Would be translated to:

        { query =&gt; {
            filtered =&gt; {
                query  =&gt; { text =&gt; { content =&gt; "search keywords" } },
                filter =&gt; {
                    and =&gt; [
                        { terms =&gt; { tags =&gt; ["perl", "ruby"] } },
                        { numeric_range =&gt; {
                            date =&gt; {
                                gt =&gt; "2010-01-01",
                                lte =&gt; "2011-01-01"
                        }}},
                    ],
                }
        }}}

    All you have to do to start using ElasticSearch::SearchBuilder is to
    change your "query" or "filter" parameter to "queryb" or "filterb"
    (where the extra "b" stands for "builder"):

        $es-&gt;search(
            queryb =&gt; { content =&gt; 'keywords' }
        )

    If you want to see what your SearchBuilder-style query is being
    converted into, you can either use "trace_calls()" or access it directly
    with:

        $native_query  = $es-&gt;builder-&gt;query( $query )
        $native_filter = $es-&gt;builder-&gt;filter( $filter )

    See the ElasticSearch::SearchBuilder docs for more information about the
    syntax.

METHODS
  Creating a new ElasticSearch instance
   new()
        $es = ElasticSearch-&gt;new(
                transport    =&gt;  'http',
                servers      =&gt;  '127.0.0.1:9200'                   # single server
                                  | ['es1.foo.com:9200',
                                     'es2.foo.com:9200'],           # multiple servers
                trace_calls  =&gt; 1 | '/path/to/log/file' | $fh
                timeout      =&gt; 30,
                max_requests =&gt; 10_000,                             # refresh server list
                                                                    # after max_requests

                no_refresh   =&gt; 0 | 1                               # don't retrieve the live
                                                                    # server list. Instead, use
                                                                    # just the servers specified
         );

    "servers" can be either a single server or an ARRAY ref with a list of
    servers. If not specified, then it defaults to "localhost" and the port
    for the specified transport (eg 9200 for "http*" or 9500 for "thrift").

    These servers are used in a round-robin fashion. If any server fails to
    connect, then the other servers in the list are tried, and if any
    succeeds, then a list of all servers/nodes currently known to the
    ElasticSearch cluster are retrieved and stored.

    Every "max_requests" (default 10,000) this list of known nodes is
    refreshed automatically. To disable this automatic refresh, you can set
    "max_requests" to 0.

    To force a lookup of live nodes, you can do:

        $es-&gt;refresh_servers();

   no_refresh()
    Regardless of the "max_requests" setting, a list of live nodes will
    still be retrieved on the first request. This may not be desirable
    behaviour if, for instance, you are connecting to remote servers which
    use internal IP addresses, or which don't allow remote "nodes()"
    requests.

    If you want to disable this behaviour completely, set "no_refresh" to 1,
    in which case the transport module will round robin through the
    "servers" list only. Failed nodes will be removed from the list (but
    added back in every "max_requests" or when all nodes have failed).

   Transport Backends
    There are various "transport" backends that ElasticSearch can use:
    "http" (the default, based on LWP), "httplite" (based on HTTP::Lite),
    "httptiny" (based on HTTP::Tiny), "curl" (based on WWW::Curl), "aehttp"
    (based on AnyEvent::HTTP), "aecurl" (based on AnyEvent::Curl::Multi) and
    "thrift" (which uses the Thrift protocol).

    Although the "thrift" interface has the right buzzwords (binary,
    compact, sockets), the generated Perl code is very slow. Until that is
    improved, I recommend one of the "http" backends instead.

    The "httplite" backend is about 30% faster than the default "http"
    backend, and will probably become the default after more testing in
    production.

    The "httptiny" backend is 1% faster again than "httplite".

    See also: ElasticSearch::Transport, "timeout()", "trace_calls()",
    &lt;http://www.elasticsearch.org/guide/reference/modules/http.html&gt; and
    &lt;http://www.elasticsearch.org/guide/reference/modules/thrift.html&gt;

  Document-indexing methods
   index()
        $result = $es-&gt;index(
            index       =&gt; single,
            type        =&gt; single,
            id          =&gt; $document_id,        # optional, otherwise auto-generated
            data        =&gt; {
                key =&gt; value,
                ...
            },

            # optional
            consistency  =&gt; 'quorum' | 'one' | 'all',
            create       =&gt; 0 | 1,
            parent       =&gt; $parent,
            percolate    =&gt; $percolate,
            refresh      =&gt; 0 | 1,
            replication  =&gt; 'sync' | 'async',
            routing      =&gt; $routing,
            timeout      =&gt; eg '1m' or '10s'
            version      =&gt; int,
            version_type =&gt; 'internal' | 'external',
        );

    eg:

        $result = $es-&gt;index(
            index   =&gt; 'twitter',
            type    =&gt; 'tweet',
            id      =&gt; 1,
            data    =&gt; {
                user        =&gt; 'kimchy',
                post_date   =&gt; '2009-11-15T14:12:12',
                message     =&gt; 'trying out Elastic Search'
            },
        );

    Used to add a document to a specific "index" as a specific "type" with a
    specific "id". If the "index/type/id" combination already exists, then
    that document is updated, otherwise it is created.

    Note:

    *   If the "id" is not specified, then ElasticSearch autogenerates a
        unique ID and a new document is always created.

    *   If "version" is passed, and the current version in ElasticSearch is
        different, then a "Conflict" error will be thrown.

    *   "data" can also be a raw JSON encoded string (but ensure that it is
        correctly encoded, otherwise you see errors when trying to retrieve
        it from ElasticSearch).

            $es-&gt;index(
                index   =&gt; 'foo',
                type    =&gt;  'bar',
                id      =&gt;  1,
                data    =&gt;  '{"foo":"bar"}'
            );

    *   "timeout" for all CRUD methods and "search()" is a query timeout,
        specifying the amount of time ElasticSearch will spend (roughly)
        processing a query. Units can be concatenated with the integer
        value, e.g., "500ms" or "1s".

        See also:
        &lt;http://www.elasticsearch.org/guide/reference/api/search/request-bod
        y.html&gt;

        Note: this is distinct from the transport timeout, see "timeout()".

    See also:
    &lt;http://www.elasticsearch.org/guide/reference/api/index_.html&gt;, "bulk()"
    and "put_mapping()"

   set()
    "set()" is a synonym for "index()"

   create()
        $result = $es-&gt;create(
            index       =&gt; single,
            type        =&gt; single,
            id          =&gt; $document_id,        # optional, otherwise auto-generated
            data        =&gt; {
                key =&gt; value,
                ...
            },

            # optional
            consistency  =&gt; 'quorum' | 'one' | 'all',
            parent       =&gt; $parent,
            percolate    =&gt; $percolate,
            refresh      =&gt; 0 | 1,
            replication  =&gt; 'sync' | 'async',
            routing      =&gt; $routing,
            timeout      =&gt; eg '1m' or '10s',
            version      =&gt; int,
            version_type =&gt; 'internal' | 'external',
        );

    eg:

        $result = $es-&gt;create(
            index   =&gt; 'twitter',
            type    =&gt; 'tweet',
            id      =&gt; 1,
            data    =&gt; {
                user        =&gt; 'kimchy',
                post_date   =&gt; '2009-11-15T14:12:12',
                message     =&gt; 'trying out Elastic Search'
            },
        );

    Used to add a NEW document to a specific "index" as a specific "type"
    with a specific "id". If the "index/type/id" combination already exists,
    then a "Conflict" error is thrown.

    If the "id" is not specified, then ElasticSearch autogenerates a unique
    ID.

    If you pass a "version" parameter to "create", then it must be 0 unless
    you also set "version_type" to "external".

    See also: "index()"

   update()
        $result = $es-&gt;update(
            index             =&gt; single,
            type              =&gt; single,
            id                =&gt; single,

            # required
            script            =&gt; $script,
          | doc               =&gt; $doc

            # optional
            params            =&gt; { params },
            upsert            =&gt; { new_doc },
            consistency       =&gt; 'quorum' | 'one' | 'all',
            fields            =&gt; ['_source'],
            ignore_missing    =&gt; 0 | 1,
            parent            =&gt; $parent,
            percolate         =&gt; $percolate,
            retry_on_conflict =&gt; 2,
            routing           =&gt; $routing,
            timeout           =&gt; '10s',
            replication       =&gt; 'sync' | 'async'
        )

    The "update()" method accepts a "script" to update, or a "doc" to be
    merged with, an existing doc, without having to retrieve and reindex the
    doc yourself, eg:

        $es-&gt;update(
            index   =&gt; 'test',
            type    =&gt; 'foo',
            id      =&gt; 123,
            script  =&gt; 'ctx._source.tags+=[tag]',
            params  =&gt; { tag =&gt; 'red' }
        );

    You can also pass a new doc which will be inserted if the doc does not
    already exist, via the "upsert" paramater.

    See &lt;http://www.elasticsearch.org/guide/reference/api/update.html&gt; for
    more.

   get()
        $result = $es-&gt;get(
            index   =&gt; single,
            type    =&gt; single or blank,
            id      =&gt; single,

            # optional
            fields          =&gt; 'field' or ['field1',...]
            preference      =&gt; '_local' | '_primary' | '_primary_first' | $string,
            refresh         =&gt; 0 | 1,
            routing         =&gt; $routing,
            parent          =&gt; $parent,
            ignore_missing  =&gt; 0 | 1,

        );

    Returns the document stored at "index/type/id" or throws an exception if
    the document doesn't exist.

    Example:

        $es-&gt;get( index =&gt; 'twitter', type =&gt; 'tweet', id =&gt; 1)

    Returns:

        {
          _id     =&gt; 1,
          _index  =&gt; "twitter",
          _source =&gt; {
                       message =&gt; "trying out Elastic Search",
                       post_date=&gt; "2009-11-15T14:12:12",
                       user =&gt; "kimchy",
                     },
          _type   =&gt; "tweet",
        }

    By default the "_source" field is returned. Use "fields" to specify a
    list of (stored) fields to return instead, or "[]" to return no fields.

    Pass a true value for "refresh" to force an index refresh before
    performing the get.

    If the requested "index", "type" or "id" is not found, then a "Missing"
    exception is thrown, unless "ignore_missing" is true.

    See also: "bulk()",
    &lt;http://www.elasticsearch.org/guide/reference/api/get.html&gt;

   exists()
        $bool = $es-&gt;exists(
            index           =&gt; single,
            type            =&gt; single,
            id              =&gt; single,

            preference      =&gt; '_local' | '_primary' | '_primary_first' | $string,
            refresh         =&gt; 0 | 1,
            routing         =&gt; $routing,
            parent          =&gt; $parent,
        );

    Returns true or false depending on whether the doc exists.

   mget()
        $docs = $es-&gt;mget(
            index          =&gt; single,
            type           =&gt; single or blank,
            ids            =&gt; \@ids,
            fields         =&gt; ['field_1','field_2'],
            filter_missing =&gt; 0 | 1
        );

        $docs = $es-&gt;mget(
            index          =&gt; single or blank,
            type           =&gt; single or blank,
            docs           =&gt; \@doc_info,
            fields         =&gt; ['field_1','field_2'],
            filter_missing =&gt; 0 | 1
        );

    "mget" or "multi-get" returns multiple documents at once. There are two
    ways to call "mget()":

    If all docs come from the same index (and potentially the same type):

        $docs = $es-&gt;mget(
            index =&gt; 'myindex',
            type  =&gt; 'mytype',   # optional
            ids   =&gt; [1,2,3],
        )

    Alternatively you can specify each doc separately:

        $docs = $es-&gt;mget(
            docs =&gt; [
                { _index =&gt; 'index_1', _type =&gt; 'type_1', _id =&gt; 1 },
                { _index =&gt; 'index_2', _type =&gt; 'type_2', _id =&gt; 2 },
            ]
        )

    Or:

        $docs = $es-&gt;mget(
            index  =&gt; 'myindex',                    # default index
            type   =&gt; 'mytype',                     # default type
            fields =&gt; ['field_1','field_2'],        # default fields
            docs =&gt; [
                { _id =&gt; 1 },                       # uses defaults
                { _index =&gt; 'index_2',
                  _type  =&gt; 'type_2',
                  _id    =&gt; 2,
                  fields =&gt; ['field_2','field_3'],
                },
            ]
        );

    If $docs or $ids is an empty array ref, then "mget()" will just return
    an empty array ref.

    Returns an array ref containing all of the documents requested. If a
    document is not found, then its entry will include "{exists =&gt; 0}". If
    you would rather filter these missing docs, pass "filter_missing =&gt; 1".

    See &lt;http://www.elasticsearch.org/guide/reference/api/multi-get.html&gt;

   delete()
        $result = $es-&gt;delete(
            index           =&gt; single,
            type            =&gt; single,
            id              =&gt; single,

            # optional
            consistency     =&gt; 'quorum' | 'one' | 'all'
            ignore_missing  =&gt; 0 | 1
            refresh         =&gt; 0 | 1
            parent          =&gt; $parent,
            routing         =&gt; $routing,
            replication     =&gt; 'sync' | 'async'
            version         =&gt; int
        );

    Deletes the document stored at "index/type/id" or throws an "Missing"
    exception if the document doesn't exist and "ignore_missing" is not
    true.

    If you specify a "version" and the current version of the document is
    different (or if the document is not found), a "Conflict" error will be
    thrown.

    If "refresh" is true, an index refresh will be forced after the delete
    has completed.

    Example:

        $es-&gt;delete( index =&gt; 'twitter', type =&gt; 'tweet', id =&gt; 1);

    See also: "bulk()",
    &lt;http://www.elasticsearch.org/guide/reference/api/delete.html&gt;

   bulk()
        $result = $es-&gt;bulk( [ actions ] )

        $result = $es-&gt;bulk(
            actions     =&gt; [ actions ]                  # required

            index       =&gt; 'foo',                       # optional
            type        =&gt; 'bar',                       # optional
            consistency =&gt; 'quorum' |  'one' | 'all'    # optional
            refresh     =&gt; 0 | 1,                       # optional
            replication =&gt; 'sync' | 'async',            # optional

            on_conflict =&gt; sub {...} | 'IGNORE'         # optional
            on_error    =&gt; sub {...} | 'IGNORE'         # optional
        );

    Perform multiple "index", "create" and "delete" actions in a single
    request. This is about 10x as fast as performing each action in a
    separate request.

    Each "action" is a HASH ref with a key indicating the action type
    ("index", "create" or "delete"), whose value is another HASH ref
    containing the associated metadata.

    The "index" and "type" parameters can be specified for each individual
    action, or inherited from the top level "index" and "type" parameters,
    as shown above.

    NOTE: "bulk()" also accepts the "_index", "_type", "_id", "_source",
    "_parent", "_routing" and "_version" parameters so that you can pass
    search results directly to "bulk()".

   "index" and "create" actions
        { index  =&gt; {
            index           =&gt; 'foo',
            type            =&gt; 'bar',
            id              =&gt; 123,
            data            =&gt; { text =&gt; 'foo bar'},

            # optional
            routing         =&gt; $routing,
            parent          =&gt; $parent,
            percolate       =&gt; $percolate,
            timestamp       =&gt; $timestamp,
            ttl             =&gt; $ttl,
            version         =&gt; $version,
            version_type    =&gt; 'internal' | 'external'
        }}

        { create  =&gt; { ... same options as for 'index' }}

    The "index" and "type" parameters, if not specified, are inherited from
    the top level bulk request.

    "data" can also be a raw JSON encoded string (but ensure that it is
    correctly encoded, otherwise you see errors when trying to retrieve it
    from ElasticSearch).

        actions =&gt; [{
            index =&gt; {
                index   =&gt; 'foo',
                type    =&gt;  'bar',
                id      =&gt;  1,
                data    =&gt;  '{"foo":"bar"}'
            }
        }]

   "delete" action
        { delete  =&gt; {
            index           =&gt; 'foo',
            type            =&gt; 'bar',
            id              =&gt; 123,

            # optional
            routing         =&gt; $routing,
            parent          =&gt; $parent,
            version         =&gt; $version,
            version_type    =&gt; 'internal' | 'external'
        }}

    The "index" and "type" parameters, if not specified, are inherited from
    the top level bulk request.

   Error handlers
    The "on_conflict" and "on_error" parameters accept either a coderef or
    the string 'IGNORE'. Normally, any errors are returned under the
    "errors" key (see "Return values").

    The logic works as follows:

    *   If the error is a versioning conflict error, or if you try to
        "create" a doc whose ID already exists, and there is an
        "on_conflict" handler, then call the handler and move on to the next
        document

    *   If the error is still unhandled, and we have an "on_error" handler,
        then call it and move on to the next document.

    *   If no handler exists, then add the error to the @errors array which
        is returned by "bulk()"

    Setting "on_conflict" or "on_error" to 'IGNORE' is the equivalent of
    passing an empty no-op handler.

    The handler callbacks are called as:

        $handler-&gt;( $action, $document, $error, $req_no );

    For instance:

    $action
            "index"

    $document
            { id =&gt; 1, data =&gt; { count =&gt; "foo" }}

    $error
            "MapperParsingException[Failed to parse [count]]; ... etc ... "

    $req_no
            0

    The $req_no is the array index of the current $action from the original
    array of @actions.

   Return values
    The "bulk()" method returns a HASH ref containing:

        {
            actions =&gt; [ the list of actions you passed in ],
            results =&gt; [ the result of each of the actions ],
            errors  =&gt; [ a list of any errors              ]
        }

    The "results" ARRAY ref contains the same values that would be returned
    for individiual "index"/"create"/"delete" statements, eg:

        results =&gt; [
             { create =&gt; { _id =&gt; 123, _index =&gt; "foo", _type =&gt; "bar", _version =&gt; 1 } },
             { index  =&gt; { _id =&gt; 123, _index =&gt; "foo", _type =&gt; "bar", _version =&gt; 2 } },
             { delete =&gt; { _id =&gt; 123, _index =&gt; "foo", _type =&gt; "bar", _version =&gt; 3 } },
        ]

    The "errors" key is only present if an error has occured and has not
    been handled by an "on_conflict" or "on_error" handler, so you can do:

        $results = $es-&gt;bulk(\@actions);
        if ($results-&gt;{errors}) {
            # handle errors
        }

    Each error element contains the "error" message plus the "action" that
    triggered the error. Each "result" element will also contain the error
    message., eg:

        $result = {
            actions =&gt; [

                ## NOTE - num is numeric
                {   index =&gt; { index =&gt; 'bar', type  =&gt; 'bar', id =&gt; 123,
                               data  =&gt; { num =&gt; 123 } } },

                ## NOTE - num is a string
                {   index =&gt; { index =&gt; 'bar', type  =&gt; 'bar', id =&gt; 123,
                               data  =&gt; { num =&gt; 'foo bar' } } },
            ],
            errors =&gt; [
                {
                    action =&gt; {
                        index =&gt; { index =&gt; 'bar', type  =&gt; 'bar', id =&gt; 123,
                                   data  =&gt; { num =&gt; 'text foo' } }
                    },
                    error =&gt; "MapperParsingException[Failed to parse [num]]; ...",
                },
            ],
            results =&gt; [
                { index =&gt; { _id =&gt; 123, _index =&gt; "bar", _type =&gt; "bar", _version =&gt; 1 }},
                {   index =&gt; {
                        error =&gt; "MapperParsingException[Failed to parse [num]];...",
                        id    =&gt; 123, index =&gt; "bar", type  =&gt; "bar",
                    },
                },
            ],

        };

    See &lt;http://www.elasticsearch.org/guide/reference/api/bulk.html&gt; for
    more details.

   bulk_index(), bulk_create(), bulk_delete()
    These are convenience methods which allow you to pass just the metadata,
    without the "index", "create" or "index" action for each record.

    These methods accept the same parameters as the "bulk()" method, except
    that the "actions" parameter is replaced by "docs", eg:

        $result = $es-&gt;bulk_index( [ docs ] );

        $result = $es-&gt;bulk_index(
            docs        =&gt; [ docs ],                    # required

            index       =&gt; 'foo',                       # optional
            type        =&gt; 'bar',                       # optional
            consistency =&gt; 'quorum' |  'one' | 'all'    # optional
            refresh     =&gt; 0 | 1,                       # optional
            replication =&gt; 'sync' | 'async',            # optional

            on_conflict =&gt; sub {...} | 'IGNORE'         # optional
            on_error    =&gt; sub {...} | 'IGNORE'         # optional
        );

    For instance:

        $es-&gt;bulk_index(
            index   =&gt; 'foo',
            type    =&gt; 'bar',
            refresh =&gt; 1,
            docs    =&gt; [
                { id =&gt; 123,                data =&gt; { text=&gt;'foo'} },
                { id =&gt; 124, type =&gt; 'baz', data =&gt; { text=&gt;'bar'} },
            ]
        );

   reindex()
        $es-&gt;reindex(
            source      =&gt; $scrolled_search,

            # optional
            bulk_size   =&gt; 1000,
            dest_index  =&gt; $index,
            quiet       =&gt; 0 | 1,
            transform   =&gt; sub {....},

            on_conflict =&gt; sub {...} | 'IGNORE'
            on_error    =&gt; sub {...} | 'IGNORE'
        )

    "reindex()" is a utility method which can be used for reindexing data
    from one index to another (eg if the mapping has changed), or copying
    data from one cluster to another.

   Params
    *   "source" is a required parameter, and should be an instance of
        ElasticSearch::ScrolledSearch.

    *   "dest_index" is the name of the destination index, ie where the docs
        are indexed to. If you are indexing your data from one cluster to
        another, and you want to use the same index name in your destination
        cluster, then you can leave this blank.

    *   "bulk_size" - the number of docs that will be indexed at a time.
        Defaults to 1,000

    *   Set "quiet" to 1 if you don't want any progress information to be
        printed to "STDOUT"

    *   "transform" should be a sub-ref which will be called for each doc,
        allowing you to transform some element of the doc, or to skip the
        doc by returning "undef".

    *   See "Error handlers" for an explanation "on_conflict" and
        "on_error".

   Examples:
    To copy the ElasticSearch website index locally, you could do:

        my $local = ElasticSearch-&gt;new(
            servers =&gt; 'localhost:9200'
        );
        my $remote = ElasticSearch-&gt;new(
            servers    =&gt; 'search.elasticsearch.org:80',
            no_refresh =&gt; 1
        );

        my $source = $remote-&gt;scrolled_search(
            search_type =&gt; 'scan',
            scroll      =&gt; '5m'
        );
        $local-&gt;reindex(source=&gt;$source);

    To copy one local index to another, make the title upper case, exclude
    docs of type "boring", and to preserve the version numbers from the
    original index:

        my $source = $es-&gt;scrolled_search(
            index       =&gt; 'old_index',
            search_type =&gt; 'scan',
            scroll      =&gt; '5m',
            version     =&gt; 1
        );

        $es-&gt;reindex(
            source      =&gt; $source,
            dest_index  =&gt; 'new_index',
            transform   =&gt; sub {
                my $doc = shift;
                return if $doc-&gt;{_type} eq 'boring';
                $doc-&gt;{_source}{title} = uc( $doc-&gt;{_source}{title} );
                return $doc;
            }
        );

    NOTE: If some of your docs have parent/child relationships, and you want
    to preserve this relationship, then you should add this to your scrolled
    search parameters: "fields =&gt; ['_source','_parent']".

    For example:

        my $source = $es-&gt;scrolled_search(
            index       =&gt; 'old_index',
            search_type =&gt; 'scan',
            fields      =&gt; ['_source','_parent'],
            version     =&gt; 1
        );

        $es-&gt;reindex(
            source      =&gt; $source,
            dest_index  =&gt; 'new_index',
        );

    See also "scrolled_search()", ElasticSearch::ScrolledSearch, and
    "search()".

   analyze()
        $result = $es-&gt;analyze(
          text          =&gt;  $text_to_analyze,           # required
          index         =&gt;  single,                     # optional

          # either
          field         =&gt;  'type.fieldname',           # requires index

          analyzer      =&gt;  $analyzer,

          tokenizer     =&gt; $tokenizer,
          filters       =&gt; \@filters,

          # other options
          format        =&gt;  'detailed' | 'text',
          prefer_local  =&gt;  1 | 0
        );

    The "analyze()" method allows you to see how ElasticSearch is analyzing
    the text that you pass in, eg:

        $result = $es-&gt;analyze( text =&gt; 'The Man' )

        $result = $es-&gt;analyze(
            text        =&gt; 'The Man',
            analyzer    =&gt; 'simple'
        );

        $result = $es-&gt;analyze(
            text        =&gt; 'The Man',
            tokenizer   =&gt; 'keyword',
            filters     =&gt; ['lowercase'],
        );

        $result = $es-&gt;analyze(
            text        =&gt; 'The Man',
            index       =&gt; 'my_index',
            analyzer    =&gt; 'my_custom_analyzer'
        );

        $result = $es-&gt;analyze(
            text        =&gt; 'The Man',
            index       =&gt; 'my_index',
            field       =&gt; 'my_type.my_field',
        );

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.
    html&gt; for more.

  Query methods
   search()
        $result = $es-&gt;search(
            index           =&gt; multi,
            type            =&gt; multi,

            # optional
            query           =&gt; { native query },
            queryb          =&gt; { searchbuilder query },

            filter          =&gt; { native filter },
            filterb         =&gt; { searchbuilder filter },

            explain         =&gt; 1 | 0,
            facets          =&gt; { facets },
            fields          =&gt; [$field_1,$field_n],
            partial_fields  =&gt; { my_field =&gt; { include =&gt; 'foo.bar.*' }},
            from            =&gt; $start_from,
            highlight       =&gt; { highlight }.
            ignore_indices  =&gt; 'none' | 'missing',
            indices_boost   =&gt; { index_1 =&gt; 1.5,... },
            min_score       =&gt; $score,
            preference      =&gt; '_local' | '_primary' | '_primary_first' | $string,
            routing         =&gt; [$routing, ...]
            script_fields   =&gt; { script_fields }
            search_type     =&gt; 'dfs_query_then_fetch'
                               | 'dfs_query_and_fetch'
                               | 'query_then_fetch'
                               | 'query_and_fetch'
                               | 'count'
                               | 'scan'
            size            =&gt; $no_of_results
            sort            =&gt; ['_score',$field_1]
            scroll          =&gt; '5m' | '30s',
            stats           =&gt; ['group_1','group_2'],
            track_scores    =&gt; 0 | 1,
            timeout         =&gt; '10s'
            version         =&gt; 0 | 1
        );

    Searches for all documents matching the query, with a request-body
    search. Documents can be matched against multiple indices and multiple
    types, eg:

        $result = $es-&gt;search(
            index   =&gt; undef,                           # all
            type    =&gt; ['user','tweet'],
            query   =&gt; { term =&gt; {user =&gt; 'kimchy' }}
        );

    You can provide either the "query" parameter, which uses the native
    ElasticSearch Query DSL, or the "queryb" parameter, which uses the more
    concise ElasticSearch::SearchBuilder query syntax.

    Similarly, use "filterb" instead of "filter". SearchBuilder can also be
    used in facets, for instance, instead of:

        $es-&gt;search(
            facets  =&gt; {
                wow_facet =&gt; {
                    query        =&gt; { text =&gt; { content =&gt; 'wow'  }},
                    facet_filter =&gt; { term =&gt; {status =&gt; 'active' }},
                }
            }
        )

    You can use:

        $es-&gt;search(
            facets  =&gt; {
                wow_facet =&gt; {
                    queryb        =&gt; { content =&gt; 'wow'   },  # note the extra 'b'
                    facet_filterb =&gt; { status =&gt; 'active' },  # note the extra 'b'
                }
            }
        )

    See "INTEGRATION WITH ElasticSearch::SearchBuilder" for more.

    For all of the options that can be included in the native "query"
    parameter, see
    &lt;http://www.elasticsearch.org/guide/reference/api/search&gt;,
    &lt;http://www.elasticsearch.org/guide/reference/api/search/request-body.ht
    ml&gt; and &lt;http://www.elasticsearch.org/guide/reference/query-dsl&gt;

   searchqs()
        $result = $es-&gt;searchqs(
            index                    =&gt; multi,
            type                     =&gt; multi,

            # optional
            q                        =&gt; $query_string,
            analyze_wildcard         =&gt; 0 | 1,
            analyzer                 =&gt; $analyzer,
            default_operator         =&gt; 'OR | AND ',
            df                       =&gt; $default_field,
            explain                  =&gt; 1 | 0,
            fields                   =&gt; [$field_1,$field_n],
            from                     =&gt; $start_from,
            ignore_indices           =&gt; 'none' | 'missing',
            lenient                  =&gt; 0 | 1,
            lowercase_expanded_terms =&gt; 0 | 1,
            preference               =&gt; '_local' | '_primary' | '_primary_first' | $string,
            quote_analyzer           =&gt; $analyzer,
            quote_field_suffix       =&gt; '.unstemmed',
            routing                  =&gt; [$routing, ...]
            search_type              =&gt; $search_type
            size                     =&gt; $no_of_results
            sort                     =&gt; ['_score:asc','last_modified:desc'],
            scroll                   =&gt; '5m' | '30s',
            stats                    =&gt; ['group_1','group_2'],
            timeout                  =&gt; '10s'
            version                  =&gt; 0 | 1

    Searches for all documents matching the "q" query_string, with a URI
    request. Documents can be matched against multiple indices and multiple
    types, eg:

        $result = $es-&gt;searchqs(
            index   =&gt; undef,                           # all
            type    =&gt; ['user','tweet'],
            q       =&gt; 'john smith'
        );

    For all of the options that can be included in the "query" parameter,
    see &lt;http://www.elasticsearch.org/guide/reference/api/search&gt; and
    &lt;http://www.elasticsearch.org/guide/reference/api/search/uri-request.htm
    l&gt;.

   scroll()
        $result = $es-&gt;scroll(
            scroll_id =&gt; $scroll_id,
            scroll    =&gt; '5m' | '30s',
        );

    If a search has been executed with a "scroll" parameter, then the
    returned "scroll_id" can be used like a cursor to scroll through the
    rest of the results.

    If a further scroll request will be issued, then the "scroll" parameter
    should be passed as well. For instance;

        my $result = $es-&gt;search(
                        query=&gt;{match_all=&gt;{}},
                        scroll =&gt; '5m'
                     );

        while (1) {
            my $hits = $result-&gt;{hits}{hits};
            last unless @$hits;                 # if no hits, we're finished

            do_something_with($hits);

            $result = $es-&gt;scroll(
                scroll_id   =&gt; $result-&gt;{_scroll_id},
                scroll      =&gt; '5m'
            );
        }

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/search/scroll.html&gt;

   scrolled_search()
    "scrolled_search()" returns a convenience iterator for scrolled
    searches. It accepts the standard search parameters that would be passed
    to "search()" and requires a "scroll" parameter, eg:

        $scroller = $es-&gt;scrolled_search(
                        query  =&gt; {match_all=&gt;{}},
                        scroll =&gt; '5m'               # keep the scroll request
                                                     # live for 5 minutes
                    );

    See ElasticSearch::ScrolledSearch, "search()", "searchqs()" and
    "scroll()".

   count()
        $result = $es-&gt;count(
            index           =&gt; multi,
            type            =&gt; multi,

            # optional
            routing         =&gt; [$routing,...]
            ignore_indices  =&gt; 'none' | 'missing',

            # one of:
            query           =&gt; { native query },
            queryb          =&gt; { search builder query },
        );

    Counts the number of documents matching the query. Documents can be
    matched against multiple indices and multiple types, eg

        $result = $es-&gt;count(
            index   =&gt; undef,               # all
            type    =&gt; ['user','tweet'],
            queryb  =&gt; { user  =&gt; 'kimchy' }
        );

    Note: "count()" supports ElasticSearch::SearchBuilder-style queries via
    the "queryb" parameter. See "INTEGRATION WITH
    ElasticSearch::SearchBuilder" for more details.

    "query" defaults to "{match_all=&gt;{}}" unless specified.

    DEPRECATION: "count()" previously took query types at the top level, eg
    "$es-&gt;count( term=&gt; { ... })". This form still works, but is deprecated.
    Instead use the "queryb" or "query" parameter as you would in
    "search()".

    See also "search()",
    &lt;http://www.elasticsearch.org/guide/reference/api/count.html&gt; and
    &lt;http://www.elasticsearch.org/guide/reference/query-dsl&gt;

   msearch()
        $results = $es-&gt;msearch(
            index       =&gt; multi,
            type        =&gt; multi,
            queries     =&gt; \@queries | \%queries,
            search_type =&gt; $search_type,
        );

    With "msearch()" you can run multiple searches in parallel. "queries"
    can contain either an array of queries, or a hash of named queries.
    $results will return either an array or hash of results, depending on
    what you pass in.

    The top-level "index", "type" and "search_type" parameters define
    default values which will be used for each query, although these can be
    overridden in the query parameters:

        $results = $es-&gt;msearch(
            index   =&gt; 'my_index',
            type    =&gt; 'my_type',
            queries =&gt; {
                first   =&gt; {
                    query =&gt; { match_all: {}}   # my_index/my_type
                },
                second  =&gt; {
                    index =&gt; 'other_index',
                    query =&gt; { match_all: {}}   # other_index/my_type
                },
            }
        )

    In the above example, $results would look like:

        {
            first  =&gt; { hits =&gt; ... },
            second =&gt; { hits =&gt; ... }
        }

    A query can contain the following options:

        {
              index          =&gt; 'index_name' | ['index_1',...],
              type           =&gt; 'type_name'  | ['type_1',...],

              query          =&gt; { native query },
              queryb         =&gt; { search_builder query },
              filter         =&gt; { native filter },
              filterb        =&gt; { search_builder filter },

              facets         =&gt; { facets },
              from           =&gt; 0,
              size           =&gt; 10,
              sort           =&gt; { sort },
              highlight      =&gt; { highlight },
              fields         =&gt; [ 'field1', ... ],

              explain        =&gt; 0 | 1,
              indices_boost  =&gt; { index_1 =&gt; 5, ... },
              ignore_indices =&gt; 'none' | 'missing',
              min_score      =&gt; 2,
              partial_fields =&gt; { partial fields },
              preference     =&gt; '_local' | '_primary' | '_primary_first' | $string,
              routing        =&gt; 'routing' | ['route_1',...],
              script_fields  =&gt; { script fields },
              search_type    =&gt; $search_type,
              stats          =&gt; 'group_1' | ['group_1','group_2'],
              timeout        =&gt; '30s',
              track_scores   =&gt; 0 | 1,
              version        =&gt; 0 | 1,
        }

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/multi-search.html&gt;.

   delete_by_query()
        $result = $es-&gt;delete_by_query(
            index           =&gt; multi,
            type            =&gt; multi,

            # optional
            consistency     =&gt; 'quorum' | 'one' | 'all'
            replication     =&gt; 'sync' | 'async'
            routing         =&gt; [$routing,...]

            # one of:
            query           =&gt; { native query },
            queryb          =&gt; { search builder query },

        );

    Deletes any documents matching the query. Documents can be matched
    against multiple indices and multiple types, eg

        $result = $es-&gt;delete_by_query(
            index   =&gt; undef,               # all
            type    =&gt; ['user','tweet'],
            queryb  =&gt; {user =&gt; 'kimchy' },
        );

    Note: "delete_by_query()" supports ElasticSearch::SearchBuilder-style
    queries via the "queryb" parameter. See "INTEGRATION WITH
    ElasticSearch::SearchBuilder" for more details.

    DEPRECATION: "delete_by_query()" previously took query types at the top
    level, eg "$es-&gt;delete_by_query( term=&gt; { ... })". This form still
    works, but is deprecated. Instead use the "queryb" or "query" parameter
    as you would in "search()".

    See also "search()",
    &lt;http://www.elasticsearch.org/guide/reference/api/delete-by-query.html&gt;
    and &lt;http://www.elasticsearch.org/guide/reference/query-dsl&gt;

   mlt()
        # mlt == more_like_this

        $results = $es-&gt;mlt(
            index               =&gt; single,              # required
            type                =&gt; single,              # required
            id                  =&gt; $id,                 # required

            # optional more-like-this params
            boost_terms          =&gt;  float
            mlt_fields           =&gt;  'scalar' or ['scalar_1', 'scalar_n']
            max_doc_freq         =&gt;  integer
            max_query_terms      =&gt;  integer
            max_word_len         =&gt;  integer
            min_doc_freq         =&gt;  integer
            min_term_freq        =&gt;  integer
            min_word_len         =&gt;  integer
            pct_terms_to_match   =&gt;  float
            stop_words           =&gt;  'scalar' or ['scalar_1', 'scalar_n']

            # optional search params
            explain              =&gt;  {explain}
            facets               =&gt;  {facets}
            fields               =&gt;  {fields}
            filter               =&gt;  { native filter },
            filterb              =&gt;  { search builder filter },
            from                 =&gt;  {from}
            indices_boost        =&gt;  { index_1 =&gt; 1.5,... }
            min_score            =&gt;  $score
            preference           =&gt;  '_local' | '_primary' | '_primary_first' | $string
            routing              =&gt;  [$routing,...]
            script_fields        =&gt;  { script_fields }
            search_scroll        =&gt;  '5m' | '10s',
            search_indices       =&gt;  ['index1','index2],
            search_from          =&gt;  integer,
            search_size          =&gt;  integer,
            search_type          =&gt;  $search_type
            search_types         =&gt;  ['type1','type],
            size                 =&gt;  {size}
            sort                 =&gt;  {sort}
            scroll               =&gt;  '5m' | '30s'
            timeout              =&gt;  '10s'
        )

    More-like-this (mlt) finds related/similar documents. It is possible to
    run a search query with a "more_like_this" clause (where you pass in the
    text you're trying to match), or to use this method, which uses the text
    of the document referred to by "index/type/id".

    This gets transformed into a search query, so all of the search
    parameters are also available.

    Note: "mlt()" supports ElasticSearch::SearchBuilder-style filters via
    the "filterb" parameter. See "INTEGRATION WITH
    ElasticSearch::SearchBuilder" for more details.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/more-like-this.html&gt;
    and
    &lt;http://www.elasticsearch.org/guide/reference/query-dsl/mlt-query.html&gt;

   explain()
        $result = $ex-&gt;explain(
            index                      =&gt;  single,
            type                       =&gt;  single,
            id                         =&gt;  single,


            query                      =&gt; { native query}
          | queryb                     =&gt; { search builder query }
          | q                          =&gt; $query_string,

            analyze_wildcard           =&gt; 1 | 0,
            analyzer                   =&gt; $string,
            default_operator           =&gt; 'OR' | 'AND',
            df                         =&gt; $default_field
            fields                     =&gt; ['_source'],
            lenient                    =&gt; 1 | 0,
            lowercase_expanded_terms   =&gt; 1 | 0,
            preference                 =&gt; _local | _primary | _primary_first | $string,
            routing                    =&gt; $routing
        );

    The explain() method is very useful for debugging queries. It will run
    the query on the specified document and report whether the document
    matches the query or not, and why.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/search/explain.html&gt;

   validate_query()
        $bool = $es-&gt;validate_query(
            index          =&gt; multi,
            type           =&gt; multi,

            query          =&gt; { native query }
          | queryb         =&gt; { search builder query }
          | q              =&gt; $query_string

            explain        =&gt; 0 | 1,
            ignore_indices =&gt; 'none' | 'missing',
        );

    Returns a hashref with "{ valid =&gt; 1}" if the passed in "query" (native
    ES query) "queryb" (SearchBuilder style query) or "q" (Lucene query
    string) is valid. Otherwise "valid" is false. Set "explain" to 1 to
    include the explanation of why the query is invalid.

    See &lt;http://www.elasticsearch.org/guide/reference/api/validate.html&gt;

  Index Admin methods
   index_status()
        $result = $es-&gt;index_status(
            index           =&gt; multi,
            recovery        =&gt; 0 | 1,
            snapshot        =&gt; 0 | 1,
            ignore_indices  =&gt; 'none' | 'missing',
        );

    Returns the status of $result = $es-&gt;index_status(); #all $result =
    $es-&gt;index_status( index =&gt; ['twitter','buzz'] ); $result =
    $es-&gt;index_status( index =&gt; 'twitter' );

    Throws a "Missing" exception if the specified indices do not exist.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-status.h
    tml&gt;

   index_stats()
        $result = $es-&gt;index_stats(
            index           =&gt; multi,
            types           =&gt; multi,

            docs            =&gt; 1|0,
            store           =&gt; 1|0,
            indexing        =&gt; 1|0,
            get             =&gt; 1|0,

            all             =&gt; 0|1,  # returns all stats
            clear           =&gt; 0|1,  # clears default docs,store,indexing,get,search

            flush           =&gt; 0|1,
            merge           =&gt; 0|1
            refresh         =&gt; 0|1,

            level           =&gt; 'shards',
            ignore_indices  =&gt; 'none' | 'missing',
        );

    Throws a "Missing" exception if the specified indices do not exist.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-stats.ht
    ml&gt;

   index_segments()
        $result = $es-&gt;index_segments(
            index           =&gt; multi,
            ignore_indices  =&gt; 'none' | 'missing',
        );

    Returns low-level Lucene segments information for the specified indices.

    Throws a "Missing" exception if the specified indices do not exist.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-segments
    .html&gt;

   create_index()
        $result = $es-&gt;create_index(
            index       =&gt; single,

            # optional
            settings    =&gt; {...},
            mappings    =&gt; {...},
            warmers     =&gt; {...},
        );

    Creates a new index, optionally passing index settings and mappings, eg:

        $result = $es-&gt;create_index(
            index   =&gt; 'twitter',
            settings =&gt; {
                number_of_shards      =&gt; 3,
                number_of_replicas    =&gt; 2,
                analysis =&gt; {
                    analyzer =&gt; {
                        default =&gt; {
                            tokenizer   =&gt; 'standard',
                            char_filter =&gt; ['html_strip'],
                            filter      =&gt; [qw(standard lowercase stop asciifolding)],
                        }
                    }
                }
            },
            mappings =&gt; {
                tweet   =&gt; {
                    properties  =&gt; {
                        user    =&gt; { type =&gt; 'string' },
                        content =&gt; { type =&gt; 'string' },
                        date    =&gt; { type =&gt; 'date'   }
                    }
                }
            },
            warmers =&gt; {
                warmer_1 =&gt; {
                    types  =&gt; ['tweet'],
                    source =&gt; {
                        queryb =&gt; { date    =&gt; { gt =&gt; '2012-01-01' }},
                        facets =&gt; {
                            content =&gt; {
                                terms =&gt; {
                                    field=&gt;'content'
                                }
                            }
                        }
                    }
                }
            }
        );

    Throws an exception if the index already exists.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-create-i
    ndex.html&gt;

   delete_index()
        $result = $es-&gt;delete_index(
            index           =&gt; multi_req,
            ignore_missing  =&gt; 0 | 1        # optional
        );

    Deletes one or more existing indices, or throws a "Missing" exception if
    a specified index doesn't exist and "ignore_missing" is not true:

        $result = $es-&gt;delete_index( index =&gt; 'twitter' );

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-i
    ndex.html&gt;

   index_exists()
        $result = $e-&gt;index_exists(
            index =&gt; multi
        );

    Returns "{ok =&gt; 1}" if all specified indices exist, or an empty list if
    it doesn't.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-indices-
    exists.html&gt;

   index_settings()
        $result = $es-&gt;index_settings(
            index           =&gt; multi,
        );

    Returns the current settings for all, one or many indices.

        $result = $es-&gt;index_settings( index=&gt; ['index_1','index_2'] );

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-get-sett
    ings.html&gt;

   update_index_settings()
        $result = $es-&gt;update_index_settings(
            index           =&gt; multi,
            settings        =&gt; { ... settings ...},
        );

    Update the settings for all, one or many indices. Currently only the
    "number_of_replicas" is exposed:

        $result = $es-&gt;update_index_settings(
            settings    =&gt; {  number_of_replicas =&gt; 1 }
        );

    Throws a "Missing" exception if the specified indices do not exist.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-update-s
    ettings.html&gt;

   aliases()
        $result = $es-&gt;aliases( actions =&gt; [actions] | {actions} )

    Adds or removes an alias for an index, eg:

        $result = $es-&gt;aliases( actions =&gt; [
                    { remove =&gt; { index =&gt; 'foo', alias =&gt; 'bar' }},
                    { add    =&gt; { index =&gt; 'foo', alias =&gt; 'baz'  }}
                  ]);

    "actions" can be a single HASH ref, or an ARRAY ref containing multiple
    HASH refs.

    Note: "aliases()" supports ElasticSearch::SearchBuilder-style filters
    via the "filterb" parameter. See "INTEGRATION WITH
    ElasticSearch::SearchBuilder" for more details.

        $result = $es-&gt;aliases( actions =&gt; [
            { add    =&gt; {
                index           =&gt; 'foo',
                alias           =&gt; 'baz',
                index_routing   =&gt; '1',
                search_routing  =&gt; '1,2',
                filterb =&gt; { foo =&gt; 'bar' }
            }}
        ]);

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.
    html&gt;

   get_aliases()
        $result = $es-&gt;get_aliases( index =&gt; multi )

    Returns a hashref listing all indices and their corresponding aliases,
    eg:

        {
           "foo" : {
              "aliases" : {
                 "foo_1" : {
                    "search_routing" : "1,2",
                    "index_routing" : "1"
                    "filter" : {
                       "term" : {
                          "foo" : "bar"
                       }
                    }
                 },
                 "foo_2" : {}
              }
           }
        }

    If you pass in the optional "index" argument, which can be an index name
    or an alias name, then it will only return the indices related to that
    argument.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.
    html&gt;

   open_index()
        $result = $es-&gt;open_index( index =&gt; single);

    Opens a closed index.

    The open and close index APIs allow you to close an index, and later on
    open it.

    A closed index has almost no overhead on the cluster (except for
    maintaining its metadata), and is blocked for read/write operations. A
    closed index can be opened which will then go through the normal
    recovery process.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-open-clo
    se.html&gt; for more

   close_index()
        $result = $es-&gt;close_index( index =&gt; single);

    Closes an open index. See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-open-clo
    se.html&gt; for more

   create_index_template()
        $result = $es-&gt;create_index_template(
            name     =&gt; single,
            template =&gt; $template,  # required
            mappings =&gt; {...},      # optional
            settings =&gt; {...},      # optional
            warmers  =&gt; {...},      # optional
        );

    Index templates allow you to define templates that will automatically be
    applied to newly created indices. You can specify both "settings" and
    "mappings", and a simple pattern "template" that controls whether the
    template will be applied to a new index.

    For example:

        $result = $es-&gt;create_index_template(
            name        =&gt; 'my_template',
            template    =&gt; 'small_*',
            settings    =&gt;  { number_of_shards =&gt; 1 }
        );

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-template
    s.html&gt; for more.

   index_template()
        $result = $es-&gt;index_template(
            name    =&gt; single
        );

    Retrieves the named index template.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-template
    s.html#GETting_a_Template&gt;

   delete_index_template()
        $result = $es-&gt;delete_index_template(
            name            =&gt; single,
            ignore_missing  =&gt; 0 | 1    # optional
        );

    Deletes the named index template.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-template
    s.html#Deleting_a_Template&gt;

   flush_index()
        $result = $es-&gt;flush_index(
            index           =&gt; multi,
            full            =&gt; 0 | 1,
            refresh         =&gt; 0 | 1,
            ignore_indices  =&gt; 'none' | 'missing',
        );

    Flushes one or more indices, which frees memory from the index by
    flushing data to the index storage and clearing the internal transaction
    log. By default, ElasticSearch uses memory heuristics in order to
    automatically trigger flush operations as required in order to clear
    memory.

    Example:

        $result = $es-&gt;flush_index( index =&gt; 'twitter' );

    Throws a "Missing" exception if the specified indices do not exist.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-flush.ht
    ml&gt;

   refresh_index()
        $result = $es-&gt;refresh_index(
            index           =&gt; multi,
            ignore_indices  =&gt; 'none' | 'missing',
        );

    Explicitly refreshes one or more indices, making all operations
    performed since the last refresh available for search. The (near)
    real-time capabilities depends on the index engine used. For example,
    the robin one requires refresh to be called, but by default a refresh is
    scheduled periodically.

    Example:

        $result = $es-&gt;refresh_index( index =&gt; 'twitter' );

    Throws a "Missing" exception if the specified indices do not exist.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-refresh.
    html&gt;

   optimize_index()
        $result = $es-&gt;optimize_index(
            index               =&gt; multi,
            only_deletes        =&gt; 0 | 1,  # only_expunge_deletes
            flush               =&gt; 0 | 1,  # flush after optmization
            refresh             =&gt; 0 | 1,  # refresh after optmization
            wait_for_merge      =&gt; 1 | 0,  # wait for merge to finish
            max_num_segments    =&gt; int,    # number of segments to optimize to
            ignore_indices      =&gt; 'none' | 'missing',
        )

    Throws a "Missing" exception if the specified indices do not exist.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize
    .html&gt;

   gateway_snapshot()
        $result = $es-&gt;gateway_snapshot(
            index           =&gt; multi,
            ignore_indices  =&gt; 'none' | 'missing',
        );

    Explicitly performs a snapshot through the gateway of one or more
    indices (backs them up ). By default, each index gateway periodically
    snapshot changes, though it can be disabled and be controlled completely
    through this API.

    Example:

        $result = $es-&gt;gateway_snapshot( index =&gt; 'twitter' );

    Throws a "Missing" exception if the specified indices do not exist.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-gateway-
    snapshot.html&gt; and
    &lt;http://www.elasticsearch.org/guide/reference/modules/gateway&gt;

   snapshot_index()
    "snapshot_index()" is a synonym for "gateway_snapshot()"

   clear_cache()
        $result = $es-&gt;clear_cache(
            index           =&gt; multi,
            bloom           =&gt; 0 | 1,
            field_data      =&gt; 0 | 1,
            filter          =&gt; 0 | 1,
            id              =&gt; 0 | 1,
            fields          =&gt; 'field1' | ['field1','fieldn',...],
            ignore_indices  =&gt; 'none' | 'missing',
        );

    Clears the caches for the specified indices. By default, clears all
    caches, but if any of "id", "field", "field_data" or "bloom" are true,
    then it clears just the specified caches.

    Throws a "Missing" exception if the specified indices do not exist.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-clearcac
    he.html&gt;

  Mapping methods
   put_mapping()
        $result = $es-&gt;put_mapping(
            index               =&gt; multi,
            type                =&gt; single,
            mapping             =&gt; { ... }      # required
            ignore_conflicts    =&gt; 0 | 1
        );

    A "mapping" is the data definition of a "type". If no mapping has been
    specified, then ElasticSearch tries to infer the types of each field in
    document, by looking at its contents, eg

        'foo'       =&gt; string
        123         =&gt; integer
        1.23        =&gt; float

    However, these heuristics can be confused, so it safer (and much more
    powerful) to specify an official "mapping" instead, eg:

        $result = $es-&gt;put_mapping(
            index   =&gt; ['twitter','buzz'],
            type    =&gt; 'tweet',
            mapping =&gt; {
                _source =&gt; { compress =&gt; 1 },
                properties  =&gt;  {
                    user        =&gt;  {type  =&gt;  "string", index      =&gt;  "not_analyzed"},
                    message     =&gt;  {type  =&gt;  "string", null_value =&gt;  "na"},
                    post_date   =&gt;  {type  =&gt;  "date"},
                    priority    =&gt;  {type  =&gt;  "integer"},
                    rank        =&gt;  {type  =&gt;  "float"}
                }
            }
        );

    See also:
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapp
    ing.html&gt; and &lt;http://www.elasticsearch.org/guide/reference/mapping&gt;

    DEPRECATION: "put_mapping()" previously took the mapping parameters at
    the top level, eg "$es-&gt;put_mapping( properties=&gt; { ... })". This form
    still works, but is deprecated. Instead use the "mapping" parameter.

   delete_mapping()
        $result = $es-&gt;delete_mapping(
            index           =&gt; multi_req,
            type            =&gt; single,
            ignore_missing  =&gt; 0 | 1,
        );

    Deletes a mapping/type in one or more indices. See also
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-m
    apping.html&gt;

    Throws a "Missing" exception if the indices or type don't exist and
    "ignore_missing" is false.

   mapping()
        $mapping = $es-&gt;mapping(
            index       =&gt; single,
            type        =&gt; multi
        );

    Returns the mappings for all types in an index, or the mapping for the
    specified type(s), eg:

        $mapping = $es-&gt;mapping(
            index       =&gt; 'twitter',
            type        =&gt; 'tweet'
        );

        $mappings = $es-&gt;mapping(
            index       =&gt; 'twitter',
            type        =&gt; ['tweet','user']
        );
        # { twitter =&gt; { tweet =&gt; {mapping}, user =&gt; {mapping}} }

    Note: the index name which as used in the results is the actual index
    name. If you pass an alias name as the "index" name, then this key will
    be the index (or indices) that the alias points to.

    See also:
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapp
    ing.html&gt;

   type_exists()
        $result = $e-&gt;type_exists(
            index          =&gt; multi,             # optional
            type           =&gt; multi,             # required
            ignore_indices =&gt; 'none' | 'missing',
        );

    Returns "{ok =&gt; 1}" if all specified types exist in all specified
    indices, or an empty list if they doesn't.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-indices-types-ex
    ists.html&gt;

  Warmer methods
    Index warming allow you to run typical search requests to "warm up" new
    segments before they become available for search. Warmup searches
    typically include requests that require heavy loading of data, such as
    faceting or sorting on specific fields.

   create_warmer()
        $es-&gt;create_warmer(
            warmer        =&gt; $warmer,
            index         =&gt; multi,
            type          =&gt; multi,

            # optional

            query         =&gt; { raw query }
          | queryb        =&gt; { search builder query },

            filter        =&gt; { raw filter }
          | filterb       =&gt; { search builder filter},

            facets        =&gt; { facets },
            script_fields =&gt; { script fields },
            sort          =&gt; { sort },
        );

    Create an index warmer called $warmer: a search which is run whenever a
    matching "index"/"type" segment is about to be brought online.

    See &lt;https://github.com/elasticsearch/elasticsearch/issues/1913&gt; for
    more.

  warmer()
        $result = $es-&gt;warmer(
            index          =&gt; multi,       # optional
            warmer         =&gt; $warmer,     # optional

            ignore_missing =&gt; 0 | 1
        );

    Returns any matching registered warmers. The $warmer can be blank, the
    name of a particular warmer, or use wilcards, eg "warmer_*". Throws an
    error if no matching warmer is found, and "ignore_missing" is false.

    See &lt;https://github.com/elasticsearch/elasticsearch/issues/1913&gt; for
    more.

  delete_warmer()
        $result = $es-&gt;delete_warmer(
            index          =&gt; multi,       # required
            warmer         =&gt; $warmer,     # required

            ignore_missing =&gt; 0 | 1
        );

    Deletes any matching registered warmers. The "index" parameter is
    required and can be set to "_all" to match all indices. The $warmer can
    be the name of a particular warmer, or use wilcards, eg "warmer_*" or
    "*" for any warmer. Throws an error if no matching warmer is found, and
    "ignore_missing" is false.

    See &lt;https://github.com/elasticsearch/elasticsearch/issues/1913&gt; for
    more.

  River admin methods
    See &lt;http://www.elasticsearch.org/guide/reference/river/&gt; and
    &lt;http://www.elasticsearch.org/guide/reference/river/twitter.html&gt;.

   create_river()
        $result = $es-&gt;create_river(
            river   =&gt; $river_name,     # required
            type    =&gt; $type,           # required
            $type   =&gt; {...},           # depends on river type
            index   =&gt; {...},           # depends on river type
        );

    Creates a new river with name $name, eg:

        $result = $es-&gt;create_river(
            river   =&gt; 'my_twitter_river',
            type    =&gt; 'twitter',
            twitter =&gt; {
                user        =&gt; 'user',
                password    =&gt; 'password',
            },
            index   =&gt; {
                index       =&gt; 'my_twitter_index',
                type        =&gt; 'status',
                bulk_size   =&gt; 100
            }
        )

   get_river()
        $result = $es-&gt;get_river(
            river           =&gt; $river_name,
            ignore_missing  =&gt; 0 | 1        # optional
        );

    Returns the river details eg

        $result = $es-&gt;get_river ( river =&gt; 'my_twitter_river' )

    Throws a "Missing" exception if the river doesn't exist and
    "ignore_missing" is false.

   delete_river()
        $result = $es-&gt;delete_river( river =&gt; $river_name );

    Deletes the corresponding river, eg:

        $result = $es-&gt;delete_river ( river =&gt; 'my_twitter_river' )

    See &lt;http://www.elasticsearch.org/guide/reference/river/&gt;.

   river_status()
        $result = $es-&gt;river_status(
            river           =&gt; $river_name,
            ignore_missing  =&gt; 0 | 1        # optional
        );

    Returns the status doc for the named river.

    Throws a "Missing" exception if the river doesn't exist and
    "ignore_missing" is false.

  Percolate methods
    See also:
    &lt;http://www.elasticsearch.org/guide/reference/api/percolate.html&gt; and
    &lt;http://www.elasticsearch.org/blog/2011/02/08/percolator.html&gt;

   create_percolator()
        $es-&gt;create_percolator(
            index           =&gt;  single
            percolator      =&gt;  $percolator

            # one of queryb or query is required
            query           =&gt;  { native query }
            queryb          =&gt;  { search builder query }

            # optional
            data            =&gt;  {data}
        )

    Create a percolator, eg:

        $es-&gt;create_percolator(
            index           =&gt; 'myindex',
            percolator      =&gt; 'mypercolator',
            queryb          =&gt; { field =&gt; 'foo'  },
            data            =&gt; { color =&gt; 'blue' }
        )

    Note: "create_percolator()" supports ElasticSearch::SearchBuilder-style
    queries via the "queryb" parameter. See "INTEGRATION WITH
    ElasticSearch::SearchBuilder" for more details.

   get_percolator()
        $es-&gt;get_percolator(
            index           =&gt;  single
            percolator      =&gt;  $percolator,
            ignore_missing  =&gt;  0 | 1,
        )

    Retrieves a percolator, eg:

        $es-&gt;get_percolator(
            index           =&gt; 'myindex',
            percolator      =&gt; 'mypercolator',
        )

    Throws a "Missing" exception if the specified index or percolator does
    not exist, and "ignore_missing" is false.

   delete_percolator()
        $es-&gt;delete_percolator(
            index           =&gt;  single
            percolator      =&gt;  $percolator,
            ignore_missing  =&gt;  0 | 1,
        )

    Deletes a percolator, eg:

        $es-&gt;delete_percolator(
            index           =&gt; 'myindex',
            percolator      =&gt; 'mypercolator',
        )

    Throws a "Missing" exception if the specified index or percolator does
    not exist, and "ignore_missing" is false.

   percolate()
        $result = $es-&gt;percolate(
            index           =&gt; single,
            type            =&gt; single,
            doc             =&gt; { doc to percolate },

            # optional
            query           =&gt; { query to filter percolators },
            prefer_local    =&gt; 1 | 0,
        )

    Check for any percolators which match a document, optionally filtering
    which percolators could match by passing a "query" param, for instance:

        $result = $es-&gt;percolate(
            index           =&gt; 'myindex',
            type            =&gt; 'mytype',
            doc             =&gt; { text =&gt; 'foo' },
            query           =&gt; { term =&gt; { color =&gt; 'blue' }}
        );

    Returns:

        {
            ok      =&gt; 1,
            matches =&gt; ['mypercolator']
        }

  Cluster admin methods
   cluster_state()
        $result = $es-&gt;cluster_state(
             # optional
             filter_blocks          =&gt; 0 | 1,
             filter_nodes           =&gt; 0 | 1,
             filter_metadata        =&gt; 0 | 1,
             filter_routing_table   =&gt; 0 | 1,
             filter_indices         =&gt; [ 'index_1', ... 'index_n' ],
        );

    Returns cluster state information.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-cluster-state.ht
    ml&gt;

   cluster_health()
        $result = $es-&gt;cluster_health(
            index                         =&gt; multi,
            level                         =&gt; 'cluster' | 'indices' | 'shards',
            timeout                       =&gt; $seconds
            wait_for_status               =&gt; 'red' | 'yellow' | 'green',
            | wait_for_relocating_shards  =&gt; $number_of_shards,
            | wait_for_nodes              =&gt; eg '&gt;=2',
        );

    Returns the status of the cluster, or index|indices or shards, where the
    returned status means:

    "red": Data not allocated
    "yellow": Primary shard allocated
    "green": All shards allocated

    It can block to wait for a particular status (or better), or can block
    to wait until the specified number of shards have been relocated (where
    0 means all) or the specified number of nodes have been allocated.

    If waiting, then a timeout can be specified.

    For example:

        $result = $es-&gt;cluster_health( wait_for_status =&gt; 'green', timeout =&gt; '10s')

    See:
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-cluster-health.h
    tml&gt;

   cluster_settings()
        $result = $es-&gt;cluster_settings()

    Returns any cluster wide settings that have been set with
    "update_cluster_settings".

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-cluster-update-s
    ettings.html&gt;

   update_cluster_settings()
        $result = $es-&gt;update_cluster_settings(
            persistent  =&gt; {...},
            transient   =&gt; {...},
        )

    For example:

        $result = $es-&gt;update_cluster_settings(
            persistent  =&gt; {
                "discovery.zen.minimum_master_nodes" =&gt; 2
            },
        )

    "persistent" settings will survive a full cluster restart. "transient"
    settings won't.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-cluster-update-s
    ettings.html&gt;

   nodes()
        $result = $es-&gt;nodes(
            nodes       =&gt; multi,
            settings    =&gt; 0 | 1,
            http        =&gt; 0 | 1,
            jvm         =&gt; 0 | 1,
            network     =&gt; 0 | 1,
            os          =&gt; 0 | 1,
            process     =&gt; 0 | 1,
            thread_pool =&gt; 0 | 1,
            transport   =&gt; 0 | 1
        );

    Returns information about one or more nodes or servers in the cluster.

    See:
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-in
    fo.html&gt;

   nodes_stats()
        $result = $es-&gt;nodes_stats(
            node    =&gt; multi,

            indices     =&gt; 1 | 0,
            clear       =&gt; 0 | 1,
            all         =&gt; 0 | 1,
            fs          =&gt; 0 | 1,
            http        =&gt; 0 | 1,
            jvm         =&gt; 0 | 1,
            network     =&gt; 0 | 1,
            os          =&gt; 0 | 1,
            process     =&gt; 0 | 1,
            thread_pool =&gt; 0 | 1,
            transport   =&gt; 0 | 1,

        );

    Returns various statistics about one or more nodes in the cluster.

    See:
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-st
    ats.html&gt;

   cluster_reroute()
        $result = $es-&gt;cluster_reroute(
            commands =&gt; [
                { move =&gt; {
                      index     =&gt; 'test',
                      shard     =&gt; 0,
                      from_node =&gt; 'node1',
                      to_node   =&gt; 'node2',
                }},
                { allocate =&gt; {
                      index         =&gt; 'test',
                      shard         =&gt; 1,
                      node          =&gt; 'node3',
                      allow_primary =&gt; 0 | 1
                }},
                { cancel =&gt; {
                      index         =&gt; 'test',
                      shard         =&gt; 2,
                      node          =&gt; 'node4',
                      allow_primary =&gt; 0 | 1
                }},
            ],
            dry_run  =&gt; 0 | 1
        );

    The "cluster_reroute" command allows you to explicitly affect shard
    allocation within a cluster. For example, a shard can be moved from one
    node to another, an allocation can be cancelled, or an unassigned shard
    can be explicitly allocated on a specific node.

    NOTE: after executing the commands, the cluster will automatically
    rebalance itself if it is out of balance. Use the "dry_run" parameter to
    see what the final outcome will be after automatic rebalancing, before
    executing the real "cluster_reroute" call.

    Without any "\@commands", the current cluster routing will be returned.

    See
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-cluster-reroute.
    html&gt;

   shutdown()
        $result = $es-&gt;shutdown(
            node        =&gt; multi,
            delay       =&gt; '5s' | '10m'        # optional
        );

    Shuts down one or more nodes (or the whole cluster if no nodes
    specified), optionally with a delay.

    "node" can also have the values "_local", "_master" or "_all".

    See:
    &lt;http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-sh
    utdown.html&gt;

   restart()
        $result = $es-&gt;restart(
            node        =&gt; multi,
            delay       =&gt; '5s' | '10m'        # optional
        );

    Restarts one or more nodes (or the whole cluster if no nodes specified),
    optionally with a delay.

    "node" can also have the values "_local", "_master" or "_all".

    See: "KNOWN ISSUES"

   current_server_version()
        $version = $es-&gt;current_server_version()

    Returns a HASH containing the version "number" string and whether or not
    the current server is a "snapshot_build".

  Other methods
   use_index()/use_type()
    "use_index()" and "use_type()" can be used to set default values for any
    "index" or "type" parameter. The default value can be overridden by
    passing a parameter (including "undef") to any request.

        $es-&gt;use_index('one');
        $es-&gt;use_type(['foo','bar']);

        $es-&gt;index(                         # index: one, types: foo,bar
            data=&gt;{ text =&gt; 'my text' }
        );

        $es-&gt;index(                         # index: two, type: foo,bar
            index=&gt;'two',
            data=&gt;{ text =&gt; 'my text' }
        )

        $es-&gt;search( type =&gt; undef );       # index: one, type: all

   trace_calls()
        $es-&gt;trace_calls(1);            # log to STDERR
        $es-&gt;trace_calls($filename);    # log to $filename.$PID
        $es-&gt;trace_calls(\*STDOUT);     # log to STDOUT
        $es-&gt;trace_calls($fh);          # log to given filehandle
        $es-&gt;trace_calls(0 | undef);    # disable logging

    "trace_calls()" is used for debugging. All requests to the cluster are
    logged either to "STDERR", or the specified filehandle, or the specified
    filename, with the current $PID appended, in a form that can be rerun
    with curl.

    The cluster response will also be logged, and commented out.

    Example: "$es-&gt;cluster_health" is logged as:

        # [Tue Oct 19 15:32:31 2010] Protocol: http, Server: 127.0.0.1:9200
        curl -XGET 'http://127.0.0.1:9200/_cluster/health'

        # [Tue Oct 19 15:32:31 2010] Response:
        # {
        #    "relocating_shards" : 0,
        #    "active_shards" : 0,
        #    "status" : "green",
        #    "cluster_name" : "elasticsearch",
        #    "active_primary_shards" : 0,
        #    "timed_out" : false,
        #    "initializing_shards" : 0,
        #    "number_of_nodes" : 1,
        #    "unassigned_shards" : 0
        # }

   query_parser()
        $qp = $es-&gt;query_parser(%opts);

    Returns an ElasticSearch::QueryParser object for tidying up query
    strings so that they won't cause an error when passed to ElasticSearch.

    See ElasticSearch::QueryParser for more information.

   transport()
        $transport = $es-&gt;transport

    Returns the Transport object, eg ElasticSearch::Transport::HTTP.

   timeout()
        $timeout = $es-&gt;timeout($timeout)

    Convenience method which does the same as:

       $es-&gt;transport-&gt;timeout($timeout)

   refresh_servers()
        $es-&gt;refresh_servers()

    Convenience method which does the same as:

        $es-&gt;transport-&gt;refresh_servers()

    This tries to retrieve a list of all known live servers in the
    ElasticSearch cluster by connecting to each of the last known live
    servers (and the initial list of servers passed to "new()") until it
    succeeds.

    This list of live servers is then used in a round-robin fashion.

    "refresh_servers()" is called on the first request and every
    "max_requests". This automatic refresh can be disabled by setting
    "max_requests" to 0:

        $es-&gt;transport-&gt;max_requests(0)

    Or:

        $es = ElasticSearch-&gt;new(
                servers         =&gt; '127.0.0.1:9200',
                max_requests    =&gt; 0,
        );

   builder_class() | builder()
    The "builder_class" is set to ElasticSearch::SearchBuilder by default.
    This can be changed, eg:

        $es = ElasticSearch-&gt;new(
                servers         =&gt; '127.0.0.1:9200',
                builder_class   =&gt; 'My::Builder'
        );

    "builder()" will "require" the module set in "builder_class()", create
    an instance, and store that instance for future use. The "builder_class"
    should implement the "filter()" and "query()" methods.

   camel_case()
        $bool = $es-&gt;camel_case($bool)

    Gets/sets the camel_case flag. If true, then all JSON keys returned by
    ElasticSearch are in camelCase, instead of with_underscores. This flag
    does not apply to the source document being indexed or fetched.

    Defaults to false.

   error_trace()
        $bool = $es-&gt;error_trace($bool)

    If the ElasticSearch server is returning an error, setting "error_trace"
    to true will return some internal information about where the error
    originates. Mostly useful for debugging.

  GLOBAL VARIABLES
        $Elasticsearch::DEBUG = 0 | 1;

    If $Elasticsearch::DEBUG is set to true, then ElasticSearch exceptions
    will include a stack trace.

AUTHOR
    Clinton Gormley, "&lt;drtech at cpan.org&gt;"

KNOWN ISSUES
    "get()"
        The "_source" key that is returned from a "get()" contains the
        original JSON string that was used to index the document initially.
        ElasticSearch parses JSON more leniently than JSON::XS, so if
        invalid JSON is used to index the document (eg unquoted keys) then
        "$es-&gt;get(....)" will fail with a JSON exception.

        Any documents indexed via this module will be not susceptible to
        this problem.

    "restart()"
        "restart()" is currently disabled in ElasticSearch as it doesn't
        work correctly. Instead you can "shutdown()" one or all nodes and
        then start them up from the command line.

BUGS
    This is a stable AP - but it will evolve as the API of ElasticSearch
    itself changes.

    If you have any suggestions for improvements, or find any bugs, please
    report them to
    &lt;http://github.com/clintongormley/ElasticSearch.pm/issues&gt;. I will be
    notified, and then you'll automatically be notified of progress on your
    bug as I make changes.

SUPPORT
    You can find documentation for this module with the perldoc command.

        perldoc ElasticSearch

    You can also look for information at:

    *   GitHub

        &lt;http://github.com/clintongormley/ElasticSearch.pm&gt;

    *   CPAN Ratings

        &lt;http://cpanratings.perl.org/d/ElasticSearch&gt;

    *   Search MetaCPAN

        &lt;https://metacpan.org/module/ElasticSearch&gt;

    *   IRC

        The #elasticsearch &lt;irc://irc.freenode.net/elasticsearch&gt; channel on
        "irc.freenode.net".

    *   Mailing list

        The main ElasticSearch mailing list
        &lt;http://www.elasticsearch.org/community/forum/&gt;.

TEST SUITE
    The full test suite requires a live ElasticSearch cluster to run. CPAN
    testers doesn't support this. You can see full test results here:
    &lt;http://travis-ci.org/#!/clintongormley/ElasticSearch/builds&gt;.

    To run the full test suite locally, run it as:

        perl Makefile.PL
        ES_HOME=/path/to/elasticsearch make test

ACKNOWLEDGEMENTS
    Thanks to Shay Bannon, the ElasticSearch author, for producing an
    amazingly easy to use search engine.

LICENSE AND COPYRIGHT
    Copyright 2010 - 2011 Clinton Gormley.

    This program is free software; you can redistribute it and/or modify it
    under the terms of either: the GNU General Public License as published
    by the Free Software Foundation; or the Artistic License.

    See http://dev.perl.org/licenses/ for more information.

</pre></body></html>