I am trying to reindex an index with python with the following function
resp = client.reindex(
body={
"source": {
"remote": {"host": "url_name:9200","username": "elastic","password": "password"},
"index": "whateverindex",
"query": {"match_all": {}}
},
"dest": {"index": "whateverindex"}
}
)
And I am getting
BadRequestError(400, 'x_content_parse_exception', '[1:217] [reindex] failed to parse field [source]')
I've been trying to understand how come does elastic can't parse the source. It's a snippet of code that I took and modified a little (added user/password) from the official documentation.
Am I missing something ?
EDIT :
Code using the source and dest parameters as Val stated in the comments :
resp = client.reindex(
source={
"remote": {"host": "waked-kibana.cws.cines.fr:9200","username": "elastic","password": "VBcpxfR*HgMAs6-nf*4c"},
"index": "covid19_api_arxiv_2012",
"query": {"match_all": {}}
},
dest = {"index": "covid19_api_arxiv_2012"})
Still have a parseing error on Source.