Created
December 15, 2016 10:28
-
-
Save markuskont/1cfffc8c813806364200ecf2fa7eaaad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from elasticsearch import Elasticsearch | |
import json | |
ES_INDEX='stackoverflow-surveys-2016' | |
es = Elasticsearch(hosts=['192.168.56.201']) | |
results = es.search(index=ES_INDEX, q='*', size=1) | |
for key, value in results['hits'].items(): | |
if key == 'hits': | |
print(json.dumps(value, sort_keys=True, indent=2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment