++ed by:

2 PAUSE users

Mickey Nasriachi
and 1 contributors


es -- The command line client of ElasticSearch.


    # List document count / size per index / type
    es ls
    es ls-types <index>

    # Create / delete an index
    es create <index>
    es delete <index>

    # Indexing / getting a document
    es put <index> <doc> # doc needs to be a JSON file
    es get <name> <type> <doc_id>

    # Search by a field
    es search <name> <type> <field>:<search string> [<size>]

    # Aliasing
    es alias   <index-name> <alias>
    es unalias <index-name> <alias>

See `perldoc es` for more info.


This program can be used to basic manipulation for day-to-day development need with ElasticSearch server. The default server is localhost:9200, to use different server, you can change it with ELASTIC_SEARCH_SERVERS environment variable.


You may supply a list of servers seperate by comma


The list of servers are used in a round-robin manner, which is the default behaviour of the underlying ElasticSearch perl module.


ls [<index sub-string>]

List all indices. Or if a sub-string is provided, list only matching ones.

ls-types <index>

List all document type of the given index.

create <index>

Create the index.

delete <index>

Delete the index

alias <index> <alias>

Add an alias for the index.

unalias <index> <alias>

Remove an alias to the index.

put <index> <type> <doc>

Put the content of doc into the index. <type> is the the documentation type. <doc> must be a valid JSON file.

get <index> <type> <doc_id>

Print the specic document as JSON.

search <index> <type> <field>:<query_string>

Perform a simple text query. Need to provide field name and a query string.


Mickey Nasriachi <mickey75@gmail.com>

Kang-min Liu <gugod@gugod.org>


This module was originally developed for Booking.com. With approval from Booking.com, this module was generalized and published on CPAN, for which the authors would like to express their gratitude.


Copyright (C) 2013 by Mickey Nasriachi

Copyright (C) 2013 by Kang-min Liu

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.