Skip to content

Instantly share code, notes, and snippets.

@yujuwon
Created August 8, 2019 06:38
Show Gist options
  • Save yujuwon/eab7213afee017322ed8af3b783a65cf to your computer and use it in GitHub Desktop.
Save yujuwon/eab7213afee017322ed8af3b783a65cf to your computer and use it in GitHub Desktop.
ES_URL ="http://127.0.0.1/index-table/type/_search"
headers = {'Content-Type': 'application/json; charset=utf-8'}
data = {"from": 0, "size": 100 }
res = requests.post(ES_URL, data=json.dumps(data), headers=headers).content
total = res['total']
index = 0
size = 100
for i in range(0, total, size):
data['from'] = index
res = json.loads(requests.post(ES_URL, data=json.dumps(data), headers=headers).content)
index = index + size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment