9

I've updated ElasticSearch to 2.1 version.

Before of that, I deleted every document in a type using:

curl -XDELETE '<server_node>:<port>/<index>/<type>' -i
curl -XDELETE 'http://ESNode01:9201/living/inputs' -i

From now then, this is the response:

HTTP/1.1 400 Bad Request Content-Type: text/plain; charset=UTF-8

Content-Length: 61

No handler found for uri [/living/inputs] and method [DELETE]

What am I doing wrong?

Jordi
  • 20,868
  • 39
  • 149
  • 333

1 Answers1

12

Deleting a mapping type is not supported anymore since 2.0.

If you just need to delete the documents, then you may use the delete by query plugin, otherwise you should create a new index without the mapping you want to delete and reindex your data.

Val
  • 207,596
  • 13
  • 358
  • 360
  • I've installed the plugin. After reboot ES, I've been able to perform: `curl -XDELETE '//_query' -i -d ' { "query": { "match_all": {} } }'` and the documents were deleted. However, I need the last thing you've just commented. I need to apply another mapping and reindex that (I open another question!) – Jordi Dec 15 '15 at 10:29
  • However, I believe, I should have to need to be able to remove a index... Does it really not possible? – Jordi Dec 15 '15 at 10:36
  • Removing an index is definitely possible, `curl -XDELETE localhost:9200/index` and you're good. That will remove the index and all mapping types of that index. This is the second option I mentioned in my answer. – Val Dec 15 '15 at 10:39
  • 2
    I need to remove only a type... Sorry for the miswriting. – Jordi Dec 15 '15 at 10:40
  • 1
    You just said index in your second comment :-) Then no, back to my answer, removing only a type is not possible in ES 2.0 onward. – Val Dec 15 '15 at 10:41
  • How do you create the new index and reindex the data? – awavi Nov 28 '16 at 22:37
  • Without the plugin I get routing_missing_exception. Is there no other way to delete the documents of type without any plugin? – rohit pal Jan 16 '22 at 07:19