gpt4 book ai didi

elasticsearch - elasticdump 导入索引设置不起作用

转载 作者:行者123 更新时间:2023-12-01 14:12:24 25 4
gpt4 key购买 nike

我可以使用下面的命令导出索引设置

elasticdump --input=http://localhost:9200/tempIndex --output=/Users/Desktop/indexFile --type=settings

但是当我尝试导入相同的设置时,它并没有更新索引设置

我用于导入的命令是:

elasticdump --input=/Users/Desktop/indexFile --output=http://localhost:9200/tempIndex --type=settings

命令输出:

 07:06:33 GMT | starting dump
07:06:33 GMT | got 1 objects from source file (offset: 0)
07:06:34 GMT | sent 1 objects to destination elasticsearch, wrote 0
07:06:34 GMT | got 0 objects from source file (offset: 1)
07:06:34 GMT | Total Writes: 0
07:06:34 GMT | dump complete

下面是我使用 elasticdump settings 选项导出的索引设置

{
"tempIndex":{
"settings":{
"index":{
"mapping":{
"nested_fields":{
"limit":"2000"
},
"total_fields":{
"limit":"2000"
}
},
"analysis":{
"normalizer":{
"lowercase_normalizer":{
"filter":[
"lowercase"
],
"type":"custom",
"char_filter":[

]
}
}
},
"number_of_shards":"5",
"number_of_replicas":"1"
}
}
}
}

最佳答案

只能在创建索引时添加设置。所以运行这条命令时索引一定不能存在。您可以通过提供适当的 URL 来短路,但由于您正在尝试更新非动态设置,它仍然会失败。

{
"error": {
"root_cause": [{
"type": "illegal_argument_exception",
"reason": "Can't update non dynamic settings [[index.number_of_shards]] for open indices [[source_index/_OdHe-IVQBemJ3YYka_9hg]]"
}],
"type": "illegal_argument_exception",
"reason": "Can't update non dynamic settings [[ index.number_of_shards]] for open indices [[source_index/_OdHe-IVQBemJ3YYka_9hg]]"
},
"status": 400
}

你可以做到

# passing in _settings path will change operation from insert to update
elasticdump --input=/Users/Desktop/indexFile --output=http://localhost:9200/tempIndex/_settings --type=settings

引用:https://github.com/taskrabbit/elasticsearch-dump/issues/549#issuecomment-501223008

关于elasticsearch - elasticdump 导入索引设置不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56287564/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com