python
from elasticsearch import Elasticsearch
es = Elasticsearch(["localhost:9200"])
python
es.indices.create(index='my_index')
python
es.index(index='my_index', id=1, body={"title": "example", "content": "This is an example document"})
python
es.search(index='my_index', body={"query": {"match": {"title": "example"}}})
python
es.search(index='my_index', body={"aggs": {"max_price": {"max": {"field": "price"}}}})
python
es.indices.delete(index='my_index')