ElasticUtils uses pyes which comes with a handy ES object. This lets you work with ElasticSearch outside of what ElasticUtils can do.
To access this, you use get_es() which builds an ES.
Create an ES object and return it.
Parameters: |
|
---|
Examples:
>>> es = get_es()
>>> es = get_es(hosts=['localhost:9200'])
>>> es = get_es(timeout=30) # good for indexing
>>> es = get_es(default_indexes=['sumo_prod_20120627']
>>> class CurlDumper(object):
... def write(self, text):
... print text
...
>>> es = get_es(dump_curl=CurlDumper())
Warning
ElasticUtils works with pyes 0.15 and 0.16. The API for later versions of pyes has changed too much and won’t work with ElasticUtils. We’re planning to switch to something different in the future.