kibanaのDev ToolsでElasticsearchを操作しています。
PUT /ss_info { "template": "ss_info", "settings" : { "number_of_shards" : 1, "number_of_replicas": 1 }, "mappings" : { "ss" : { "properties" : { "ss_id" : { "type" : "integer" }, "ss_name" : { "type" : "text" }, "location" : { "type" : "geo_point" } } } } }
このqueryを実行しindexを作成したところ。
GET /ss_info/_mapping { "ss_info": { "mappings": { "ss": { "properties": { "location": { "type": "geo_point" }, "ppp": { "type": "text" }, "ss_id": { "type": "integer" }, "ss_name": { "type": "text" } } } } } }
上記のように作られており、知らないpppが含まれていました。
他のindexを確認したところ、
GET /_cat/indices?v health status index uuid pri rep docs.count docs.deleted store.size pri.store.size green open ss_info ZPDvwPTsTN60rbLFWRqfTw 1 1 0 0 460b 230b green open ss_v1 rs_LfUscTQ-r8ACqnDq4xA 1 1 10 0 10.7kb 5.3kb
GET /ss_v1/_mapping { "ss_v1": { "mappings": { "ss": { "properties": { "ppp": { "type": "text" }, "ss_id": { "type": "integer" }, "ss_name": { "type": "text" } } } } } }
このように、すでにssというtypeが作成されていました。
そこで、typeの名前を変えて
PUT /ss_info { "template": "ss_info", "settings" : { "number_of_shards" : 1, "number_of_replicas": 1 }, "mappings" : { "ss2" : { "properties" : { "ss_id" : { "type" : "integer" }, "ss_name" : { "type" : "text" }, "location" : { "type" : "geo_point" } } } } }
というqueryを実行したところ、
{ "error": { "root_cause": [ { "type": "remote_transport_exception", "reason": "[CeiBnok][x.x.x.x:9300][indices:admin/create]" } ], "type": "illegal_argument_exception", "reason": "Rejecting mapping update to [ss_info] as the final mapping would have more than 1 type: [ss, ss2]" }, "status": 400 }
こちらのエラーが発生しました。
こちらのエラーを調べたところ、
https://qiita.com/morin_river/items/a78f7c85030984222e5e これに伴い、ElasticSearch6.0から複数のmapping_typeの指定でドキュメントが投入された時 以下のようなエラー文言でリクエストが弾かれるようになっています。
こちらが見つかったのですが、名前をss2に変えて、別の名前を指定しているのに、このエラーが出る理由がわかりません。
わかる方よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー