The official elasticsearch python client
from elasticsearch import Elasticsearch
es = Elasticsearch()
result = es.get(index="test_index", id=1)
print(result)
or
import urllib2
import json
response = urllib2.urlopen('http://localhost:9200/test_index/_search?q=_id:1', )
result = json.loads(response.read())
print(result)
Which of above is best way to query elasticsearch from python?