curl - How can I delete multiple data in specific index in elasticsearch -
i need delete multiple record in specified index/type. follow document stil have same issue
i need delete documents in gvisitor type in g_visitor index, follow below command
curl -xdelete http://10.1.2.10:9200/g_visitor/gvisitor
its throw below error
no handler found uri [/g_visitor/gvisitor] , method [delete]
then follow install delete query plugin , try remove documents ,
curl -xdelete 'http://10.1.2.10:9200/g_visitor/gvisitor/_delete_by_query?conflicts=proceed' -d '{ "query" : { "match_all" : {} } }'
its throw below error:
{ "found":false, "_index":"g_visitor", "_type":"gvisitor", "_id":"_delete_by_query", "_version":1, "_shards":{ "total":2, "successful":1, "failed":0 } }
suggeset me, how can delete multiple or documents in specific type of index in elasticsearch.
you cannot delete mapping type, hence why first query doesn't work.
you can delete index
curl -xdelete http://10.1.2.10:9200/g_visitor
if want use delete-by-query approach, can so, need install plugin first
sudo bin/plugin install delete-by-query
then can use plugin calling _query
endpoint (not _delete_by_query
!!):
curl -xdelete 'http://10.1.2.10:9200/g_visitor/gvisitor/_query?conflicts=proceed' -d '{ "query" : { "match_all" : {} } }'
Comments
Post a Comment