今日のひとこと Challange IT For Future

Can’t merge because of conflicts: [Cannot update includes setting for [_source]]

elasticsearch 読了 2分

この記事は最終更新から 7 年以上たっています。内容が現在の状況と異なる可能性があります。現在の情報は最新の記事、Fess の記事をご覧ください。

$ curl -XPUT -H "Content-Type:application/json" localhost:9201/test_put_mapping2/_mapping -d '{"_source":{"includes":["aaa"]}}'

みたいな感じで、PUT Mappingでmappings/_sourceを変更すると、

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Can't merge because of conflicts: [Cannot update includes setting for [_source]]"}],"type":"illegal_argument_exception","reason":"Can't merge because of conflicts: [Cannot update includes setting for [_source]]"},"status":400}

という感じで怒られるけど、ここによると_sourceは変更できないから。Create Indexでやる必要がある。