Delete a specific type from an index

Hey,

I have one index named logstash_ecps-rct* and i have many types in it.
i want to delete the type: mssql from it so i tried devtools:
DELETE logstash-ecps_rct*/mssql and i got this error
No handler found for uri [/logstash-ecps_rct*/mssql] and method [DELETE]
can anyone tell me how to delete a specific type from an index

Thanks!

I'm by no means an expert when it comes to this specific issue but as far as I know, you can't really do that (delete documents).

You would have to reindex and leave out that type. I have had very limited success with my own reindexing attempts so can't help you there but interested to see what people with more experience say.

Got curious so looked at the API documentation.

@cilzzz, you probably need to use https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-delete-by-query.html

Something like

POST twitter/_delete_by_query
{
  "query": { 
    "match": {
      "type": "mssql"
    }
  }
} 

Not exactly what you wanted to do. It should remove all documents of type: mssql but the mapping will remain. To remove a mapping you would have to reindex.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.