Help with reindex() function

Hi Elastic team,

I'm trying to make a Python reindexing script using the Elasticsearch library, but I'm not sure how reindex() function should be used.
The script would be executed by typing: python auto_reindex YYYY.MM.DD, as you see, expecting date, because my indices are called xxxxxxx-YYY.MM.DD.

This is how I created the Elasticsearch object: es = Elasticsearch({"host": "localhost", "port": 9200}). My Elasticserach is running at port 9200.

I'm getting an error at the following line:


The error I'm getting is:

Traceback (most recent call last):
File "auto_reindex_test", line 20, in
KeyError: '"source"'

I'm sure I'm doing something wrong but I don't know what it is. Could someone tell me how should I properly create my Elasticsearch object if I'm doing it wrong, or how to use the function reindex() to reindex the index xxxxxx-YY.MM.DD into xxxxxx-tmp-YY.MM.DD?

Some help would be really appreciated.

Best regards,

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.