jprante / elasticsearch-knapsack

Knapsack plugin is an import/export tool for Elasticsearch
Apache License 2.0
472 stars 77 forks source link

Modifying mapping is not working #81

Open subburaj45 opened 9 years ago

subburaj45 commented 9 years ago

I have to modify the mappings for the index what i am importing.So for trial purpose i am following the link: https://github.com/jprante/elasticsearch-knapsack/issues/48 to create test index and export , import is working fine.

I have to modify the mapping for the index: curl -XPUT localhost:9200/test/test/1 -d '{"key":1.81}' curl -XPUT localhost:9200/test/test/2 -d '{"key":1}'

curl -XGET 'localhost:9200/test/test/_search?q=*&pretty' { "took" : 5, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 }, "hits" : { "total" : 2, "max_score" : 1.0, "hits" : [ { "_index" : "test", "_type" : "test", "_id" : "1", "_score" : 1.0, "_source":{"key":1.81} }, { "_index" : "test", "_type" : "test", "_id" : "2", "_score" : 1.0, "_source":{"key":1} } ] } }

curl -XGET 'http://localhost:9200/test/_mapping/test' {"test":{"mappings":{"test":{"properties":{"key":{"type":"long"}}}}}}

I need to change the mapping to double. My mapping_test.json is as follows: {"test":{"properties":{"key":{"type":"double"}}}}

Now i deleted the "test" index and importing using the following command: curl -XPOST 'localhost:9200/test/test/_import?test_test_mapping=/home/testuser/mapping_test.json' but still the mapping is "long" not changed to double.

jprante commented 9 years ago

I can not reproduce. What are the commands you executed?

subburaj45 commented 9 years ago

For Export i used: curl -XPOST localhost:9200/test/test/_export For import i used: curl -XPOST 'localhost:9200/test/test/_import?test_test_mapping=/home/testuser/mapping_test.json'

and my mapping_test.json content is as follows: {"test":{"properties":{"key":{"type":"double"}}}}