Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.


elseql is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
0.2.3 Failed View build log
Linux (64-bit)
0.2.3 Failed View build log
Lastest release
version 0.2.3 on Nov 23rd, 2012

A SQL-like command line / REPL client for ElasticSearch


elseql [--debug] [--port=host:port]


  • select - see SEARCH SYNTAX
  • describe [index]
  • set options [on|off]
  • help


SELECT {fields}
[FACETS facet-fields] [SCRIPT script-field = 'script'] FROM index [WHERE where-condition] [FILTER filter-condition] [ORDERY BY order-fields] [LIMIT [start,] count]

fields: '*' or comma-separated list of field names to be returned

facet-fields: comma-separated list of fields to execute a facet query on

script-field: name of script field, to be used in select clause script: ElasticSearch script

index: index to query

{field-name} [ = != > >= < <= ] {value} {field-name} LIKE {value} {field-name} IN (value1, value2, ...) {field-name} BETWEEN {min-value} AND {max-value} NOT {where-condition} {where-condition} AND {where-condition} {where-condition} OR {where-condition}
or where-condition:
'query in Lucene syntax'
QUERY {where-condition} - query filter, same syntax as where condition EXIST {field-name} - exists field filter MISSING {field.name} - missing field filter

order-fields: comma-separated list of {field-name} [ASC | DESC]

start: start index for pagination count: maximum number of returned results

A special case for LIMIT start,count allows to do a "scroll" query (i.e. results will be returned in batches):

start: -1 - enable "scroll" query count: batch size - the query will return {count} results (actually {count} per shard) and will be repeated until all results are returned.

This is very useful when you are expecting large result sets (or you are doing a full table scan). Note that in "scroll" mode sort and facets are disabled.


From pypi:

sudo easy_install elseql

System Message: WARNING/2 (<string>, line 74)

Block quote ends without a blank line; unexpected unindent.
sudo pip install elseql

With python and setuptools installed:

sudo python setup.py install

You can also run the command without installing as:

python -m elseql.elseql

To do this you will need the pyparsing, rawes and cmd2 packages installed, that are automatically installed in the previous step.

sudo easy_install pyparsing sudo easy_install rawes sudo easy_install cmd2

The cmd2 package add a few extra features "command-line" related features. The most useful is redirection:

elsesql> select id,field1,field2 from index where condition > result.csv

Note that because '>' is used for redirection you'll need to use GT in the where clause insted (also available LT, GTE, LTE)


http://elasticsearch.org/, You know, for Search

Subscribe to package updates

Last updated Nov 23rd, 2012

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.