ela

ElasticQuery

A simple (Python) query builder for Elasticsearch

Showing:

Popularity

Downloads/wk

0

GitHub Stars

77

Maintenance

Last Commit

7mos ago

Contributors

9

Package

Dependencies

0

License

Categories

Readme

ElasticQuery v3 PyPI version

A simple query builder for Elasticsearch. Install with pip install elasticquery. Uses metod calls and their args/kwargs to generate query/filter/aggregate objects. Outputs dict/json representation to be passed directly to ES.

Synopsis

from elasticsearch import Elasticsearch
from elasticquery import ElasticQuery, Filter, Aggregate


# Create a query with our ES index details
q = ElasticQuery(
    es=Elasticsearch(),
    index='mapping_test',
    doc_type='doc_mapping'
)

# Query it!
q.query(
    Query.terms('my_field', ['my', 'terms'])
)

# Aggregate it!
q.aggregate(
    Aggregate.sum('my_agg', 'my_field')
)

# Print the query, then run on ES and print it's output
print q.json(indent=4)
print q.get()

Development/Testing

  • Create virtualenv
  • pip install -r requirements.pip
  • Run nosetests

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial