1

i want to import json into elastic using crul and below is the command and error

curl -XPUT "http://localhost:9200/test/"
 -H "Content-Type: application/json" -d @City_collection.json

and i am getting below error.pls help me

    {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"unknown s
etting [index.City2] please check that any required plugins are installed, or ch
eck the breaking changes documentation for removed settings"}],"type":"illegal_a
rgument_exception","reason":"unknown setting [index.City2] please check that any
 required plugins are installed, or check the breaking changes documentation for
 removed settings"},"status":400}

my json file is below:

{ "_id" : { "$oid" : "5b45f0c652fdfb145c6dfc74" }, "City" : "Irvine", "City_id" : 0 }
{ "_id" : { "$oid" : "5b45f0c652fdfb145c6dfc75" }, "City" : "Huntington Beach", "City_id" : 1 }
{ "_id" : { "$oid" : "5b45f0c652fdfb145c6dfc76" }, "City" : "Gardena", "City_id" : 2 }
{ "_id" : { "$oid" : "5b45f0c652fdfb145c6dfc77" }, "City" : "Anaheim", "City_id" : 3 }
{ "_id" : { "$oid" : "5b45f0c652fdfb145c6dfc78" }, "City" : "Placentia", "City_id" : 4 }
{ "_id" : { "$oid" : "5b45f0c652fdfb145c6dfc79" }, "City" : "STE. 208", "City_id" : 5 }
{ "_id" : { "$oid" : "5b45f0c652fdfb145c6dfc7a" }, "City" : "Beverly Hills", "City_id" : 6 }
{ "_id" : { "$oid" : "5b45f0c652fdfb145c6dfc7b" }, "City" : "Quincy", "City_id" : 7 }
Pirai Sudie
  • 162
  • 3
  • 17
  • `-XPUT` looks like a typo, there should be a space there. I don't know whether curl accepts this or not but I'd assume not. – Tom W Sep 05 '18 at 06:29
  • 1
    You might want to use the `_bulk` endpoint and one of the answers you're looking for is here: https://stackoverflow.com/questions/33340153/elasticsearch-bulk-index-json-data/33340234#33340234 – Val Sep 05 '18 at 06:30

0 Answers0