Created
August 8, 2019 06:43
-
-
Save yujuwon/9b49dad6f9619611a2400a8f67f7e76a 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
ES_URL="http://127.0.0.1/index-table/type/_search/?scroll=1m" | |
SCROLL_URL="http://127.0.0.1/_search/scroll" | |
headers = {'Content-Type': 'application/json; charset=utf-8'} | |
data = {"size": 100} | |
res = json.loads(requests.get(ES_URL, data=json.dumps(data), headers=headers).content) | |
scroll_data = {"scroll":"1m", "scroll_id" : res['_scroll_id']} | |
while(len(res) > 0): | |
res = json.loads(requests.get(SCROLL_URL, data=json.dumps(scroll_data), headers=headers).content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment