我正在使用 python 包 ElasticSearch 重命名 Elastic Search Index。 'transcripts' 已经是一个索引。以下是代码:
from elasticsearch import Elasticsearch
es_host = "https://localhost:9200"
password = "PASSWORD_STRING"
es_client = Elasticsearch(es_host,basic_auth=('elastic', password),verify_certs=False)
es_client.reindex(source='transcripts',dest='transcript_sent')
出现以下错误:
BadRequestError: BadRequestError(400, 'x_content_parse_exception', "[1:9] [reindex] dest doesn't support values of type: VALUE_STRING")
你可以尝试吗:
client.reindex(body={
"source": {
"index": "transcripts"},
"dest": {"index": "transcript_sent"}
})
希望这有帮助!