Elasticsearch : How to delete an Index using python

AbtPst

Forgive me if this is quite basic but I have Python 2.7 and Elasticsearch 2.1.1 and I am just trying to delete an index using

es.delete(index='researchtest', doc_type='test')

but this gives me

return func(*args, params=params, **kwargs)
TypeError: delete() takes at least 4 arguments (4 given)

I also tried

es.delete_by_query(index='researchtest', doc_type='test',body='{"query":{"match_all":{}}}')

but I get

AttributeError: 'Elasticsearch' object has no attribute 'delete_by_query'

Any idea why? Has the api changed for 2.1.1 for python?

https://elasticsearch-py.readthedocs.org/en/master/api.html#elasticsearch.client.IndicesClient.delete

ferdy

From the docs, use this notation:

from elasticsearch import Elasticsearch
es = Elasticsearch()

es.indices.delete(index='test-index', ignore=[400, 404])

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to delete index in elasticsearch 5.6.3

From Dev

Delete documents from ElasticSearch index in python

From Dev

How to store key-value pairs in an elasticsearch index using python

From Dev

How to store key-value pairs in an elasticsearch index using python

From Dev

Delete entire index in ElasticSearch

From Dev

Delete Indexes by index name and type using elasticSearch 2.3.3 in java

From Dev

Elasticsearch 2.1: how to delete by query using curl

From Dev

How do we delete only certain events in an index in elasticsearch?

From Dev

How to Synchronize the DB from Index Using Elasticsearch

From Dev

Not clear how to upsert ElasticSearch using python elasticsearch

From Dev

how to create a nested index in ElasticSearch with Python?

From Dev

Elasticsearch: Async "delete by query" and index

From Java

How to copy the content inside index after modification to another in Elasticsearch using python

From Dev

How to check if an index exists in elasticsearch using a python script and perform exception handling over it?

From Dev

Python api to delete -- elasticsearch

From Dev

How to delete several documents by ID in one operation using Elasticsearch Nest

From Dev

How to delete document matching a query using official elasticsearch nodejs client?

From Dev

How to delete all log data from ElasticSearch using curl?

From Dev

How to bulk delete docs from elasticsearch using php

From Dev

How to delete document matching a query using official elasticsearch nodejs client?

From Dev

How to delete a row in dojo EnhancedGrid using row index not by using selection

From Dev

delete list element by index while iterating using python

From Dev

How to change field types for existing index using Elasticsearch Mapping API

From Dev

Elasticsearch how to index text files using the command line

From Dev

How do I specify an index for Elasticsearch using NEST?

From Dev

Elasticsearch how to index text files using the command line

From Dev

How to index array data type from mongodb to elasticsearch using logstash

From Dev

Elasticsearch DELETE too fast after index?

From Dev

How to use Elasticsearch bulk index with single JSON file in Python

Related Related

  1. 1

    How to delete index in elasticsearch 5.6.3

  2. 2

    Delete documents from ElasticSearch index in python

  3. 3

    How to store key-value pairs in an elasticsearch index using python

  4. 4

    How to store key-value pairs in an elasticsearch index using python

  5. 5

    Delete entire index in ElasticSearch

  6. 6

    Delete Indexes by index name and type using elasticSearch 2.3.3 in java

  7. 7

    Elasticsearch 2.1: how to delete by query using curl

  8. 8

    How do we delete only certain events in an index in elasticsearch?

  9. 9

    How to Synchronize the DB from Index Using Elasticsearch

  10. 10

    Not clear how to upsert ElasticSearch using python elasticsearch

  11. 11

    how to create a nested index in ElasticSearch with Python?

  12. 12

    Elasticsearch: Async "delete by query" and index

  13. 13

    How to copy the content inside index after modification to another in Elasticsearch using python

  14. 14

    How to check if an index exists in elasticsearch using a python script and perform exception handling over it?

  15. 15

    Python api to delete -- elasticsearch

  16. 16

    How to delete several documents by ID in one operation using Elasticsearch Nest

  17. 17

    How to delete document matching a query using official elasticsearch nodejs client?

  18. 18

    How to delete all log data from ElasticSearch using curl?

  19. 19

    How to bulk delete docs from elasticsearch using php

  20. 20

    How to delete document matching a query using official elasticsearch nodejs client?

  21. 21

    How to delete a row in dojo EnhancedGrid using row index not by using selection

  22. 22

    delete list element by index while iterating using python

  23. 23

    How to change field types for existing index using Elasticsearch Mapping API

  24. 24

    Elasticsearch how to index text files using the command line

  25. 25

    How do I specify an index for Elasticsearch using NEST?

  26. 26

    Elasticsearch how to index text files using the command line

  27. 27

    How to index array data type from mongodb to elasticsearch using logstash

  28. 28

    Elasticsearch DELETE too fast after index?

  29. 29

    How to use Elasticsearch bulk index with single JSON file in Python

HotTag

Archive