I am able to export index setting using below command
elasticdump --input=http://localhost:9200/tempIndex --output=/Users/Desktop/indexFile --type=settings
but when i tried to import the same setting it is not updating the index setting
The command i used for import is :
elasticdump --input=/Users/Desktop/indexFile --output=http://localhost:9200/tempIndex --type=settings
output of command :
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
Below is the settings of my index exported using elasticdump settings option
{
"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"
}
}
}
}
Settings can only be added on index creation. So the index must not exist when running this command. You can short-circuit by supplying the appropriate URL, but it still would fail due to the fact that you are trying to update non-dynamic settings.
{
"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
}
You can do
# passing in _settings path will change operation from insert to update
elasticdump --input=/Users/Desktop/indexFile --output=http://localhost:9200/tempIndex/_settings --type=settings
reference:https://github.com/taskrabbit/elasticsearch-dump/issues/549#issuecomment-501223008
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With