Skip to content

Instantly share code, notes, and snippets.

@kazusato
Created July 30, 2019 19:47
Show Gist options
  • Save kazusato/e99f963551a01b6c10bb23f68e4c3c3c to your computer and use it in GitHub Desktop.
Save kazusato/e99f963551a01b6c10bb23f68e4c3c3c to your computer and use it in GitHub Desktop.
Elasticsearch実践ガイドメモ_p102_2

Operation 3-26「ドキュメントの登録の例」で、

$ curl -XPOST 'http://localhost:9200/accesslog-2017.11.10/accesslog_type/' ...

としている。

ドキュメントタイプは指定できなくなったことから、

$ curl -XPOST 'http://localhost:9200/flight-20190731' ...

のようにしてElasticsearch 7.2.1で実行すると、

{"error":"Incorrect HTTP method for uri [/flight-20190731] and method [POST], allowed: [DELETE, GET, PUT, HEAD]","status":405}

正しくは、ドキュメントの登録は、

$ curl -XPOST 'http://localhost:9200/flight-20190731/_doc' ...

とする必要がある。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment