curl -X POST -d @ mapping.json + mapowanie nie zostało utworzone
Uczę się elasticsearch. Podałem mapowanie w 'mapping.json'. Jego zawartość jest
{
"book" : {
"_index" : {
"enabled" : true
},
"_id" : {
"index": "not_analyzed",
"store" : "yes"
},
"properties" : {
"author" : {
"type" : "string"
},
"characters" : {
"type" : "string"
},
"copies" : {
"type" : "long",
"ignore_malformed" : false
},
"otitle" : {
"type" : "string"
},
"tags" : {
"type" : "string"
},
"title" : {
"type" : "string"
},
"year" : {
"type" : "long",
"ignore_malformed" : false,
"index" : "analyzed"
},
"available" : {
"type" : "boolean",
"index" : "analyzed"
}
}
}
}
Obecne mapowania są
$ curl -XGET http://localhost:9200/_mapping?pretty
=> {
"development_users" : {
"user" : {
"properties" : {
"email" : {
"type" : "string"
},
"first_name" : {
"type" : "string"
},
"id" : {
"type" : "string",
"index" : "not_analyzed",
"omit_norms" : true,
"index_options" : "docs",
"include_in_all" : false
},
"last_name" : {
"type" : "string"
},
"role" : {
"type" : "string"
}
}
}
}
}
Tworzę mapowanie książek za pomocą polecenia
$ curl http://localhost:9200/books -X POST -d @mapping.json
=> {"ok":true,"acknowledged":true}
Ale kiedy wymieniam wszystkie mapowania, otrzymuję:
$ curl -XGET http://localhost:9200/_mapping?pretty
=> { "books" : { },
"development_users" : {
"user" : {
"properties" : {
"email" : {
"type" : "string"
},
"first_name" : {
"type" : "string"
},
"id" : {
"type" : "string",
"index" : "not_analyzed",
"omit_norms" : true,
"index_options" : "docs",
"include_in_all" : false
},
"last_name" : {
"type" : "string"
},
"role" : {
"type" : "string"
}
}
}
}
}
dlaczego mapowanie książek nie jest tworzone w sposób określony w pliku mapping.json?