daily pastebin goal
9%
SHARE
TWEET

leitura.py

correiabrux Jan 25th, 2019 (edited) 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ pip install elasticsearch
  2.  
  3. from elasticsearch import Elasticsearch
  4. es = Elasticsearch(['http://127.0.0.1:9200'])
  5.  
  6. res = es.search(index="test-index", body={"query": {"match_all": {}}})
  7. print("Got %d Hits:" % res['hits']['total'])
  8. for hit in res['hits']['hits']:
  9.     print("%(timestamp)s %(author)s: %(text)s" % hit["_source"])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top