Delete all entries from a type

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Delete all entries from a type

bruskie24
Is there a method of deleting all entries in a specific type in an Index without deleting the whole type and also preserving the mapping for that type? I want to clear out a type without having to reindex or remove the type. Is this possible? I've tried variations of match_all and wildcard queries and haven't had any luck.

Right now I'm trying
curl -XDELETE 'http://localhost:9200/index/type/_query?q=_id:*', and it seems to return successful in the terminal window, but doesn't actually delete the entries in my type.
Reply | Threaded
Open this post in threaded view
|

Re: Delete all entries from a type

dadoonet
May be this?

curl -XDELETE 'http://localhost:9200/index/type/_query?q=_type:type'

--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 27 mars 2014 à 14:43, bruskie24 <[hidden email]> a écrit :
>
> Is there a method of deleting all entries in a specific type in an Index
> without deleting the whole type and also preserving the mapping for that
> type? I want to clear out a type without having to reindex or remove the
> type. Is this possible? I've tried variations of match_all and wildcard
> queries and haven't had any luck.
>
> Right now I'm trying
> curl -XDELETE 'http://localhost:9200/index/type/_query?q=_id:*', and it
> seems to return successful in the terminal window, but doesn't actually
> delete the entries in my type.
>
>
>
> --
> View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Delete-all-entries-from-a-type-tp4052902.html
> Sent from the ElasticSearch Users mailing list archive at Nabble.com.
>
> --
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1395927812876-4052902.post%40n3.nabble.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4768EB3A-2FD6-4D0D-877D-FE36D31E1B03%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Delete all entries from a type

bruskie24
Yes, that worked, thanks!