NAME

es -- The command line client of ElasticSearch.

SYNOPSIS

# 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.

DESCRIPTION

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.

ESASTIC_SEARCH_SERVERS=search-server.company.com:9200

You may supply a list of servers seperate by comma

ESASTIC_SEARCH_SERVERS=search-server-1.company.com:9200,search-server-2.company.com:9200

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

COMMANDS

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.

AUTHORS

Mickey Nasriachi <mickey75@gmail.com>

Kang-min Liu <gugod@gugod.org>

ACKNOWLEDGMENT

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 AND LICENSE

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.