无法重新索引 Elastic Search 索引名称

问题描述 投票:0回答:1

我正在使用 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")
python elasticsearch
1个回答
0
投票

你可以尝试吗:

client.reindex(body={
  "source": {
      "index": "transcripts"},
  "dest": {"index": "transcript_sent"}
  })

希望这有帮助!

© www.soinside.com 2019 - 2024. All rights reserved.