elasticsearch-bulk-api

Reindexing Elastic search via Bulk API, scan and scroll

笑着哭i 提交于 2019-11-30 06:38:31
问题 I am trying to re-index my Elastic search setup, currently looking at the Elastic search documentation and an example using the Python API I'm a little bit confused as to how this all works though. I was able to obtain the scroll ID from the Python API: es = Elasticsearch("myhost") index = "myindex" query = {"query":{"match_all":{}}} response = es.search(index= index, doc_type= "my-doc-type", body= query, search_type= "scan", scroll= "10m") scroll_id = response["_scroll_id"] Now my question

Reindexing Elastic search via Bulk API, scan and scroll

为君一笑 提交于 2019-11-28 20:46:55
I am trying to re-index my Elastic search setup, currently looking at the Elastic search documentation and an example using the Python API I'm a little bit confused as to how this all works though. I was able to obtain the scroll ID from the Python API: es = Elasticsearch("myhost") index = "myindex" query = {"query":{"match_all":{}}} response = es.search(index= index, doc_type= "my-doc-type", body= query, search_type= "scan", scroll= "10m") scroll_id = response["_scroll_id"] Now my question is, what use is this to me? What does knowing the scrolling id even give me? The documentation says to

How to use Bulk API to store the keywords in ES by using Python

∥☆過路亽.° 提交于 2019-11-26 09:17:31
问题 I have to store some message in ElasticSearch integrate with my python program. Now what I try to store the message is: d={\"message\":\"this is message\"} for index_nr in range(1,5): ElasticSearchAPI.addToIndex(index_nr, d) print d That means if I have 10 messages then I have to repeat my code 10 times. So what I want to do is try to make a script file or batch file. I\'ve checked the ElasticSearch Guide, BULK API is possible to use. The format should be something like below: { \"index\" : {