2

I want to delete an entire index of elastic search which i had created using the following code in python notebook.

es.index(index='para', doc_type='people', id=1, body={
    "name":"Farid ullah",
    "height":"160",
    "age":"23",
    "gender":"male",
    "date of birth":"04/02/1994",
    "Qualification":"BS in Software engineering"

})

the delete command is as follows,

es.delete(index='para', doc_type='people'), but I get the following error

TypeError                                 Traceback (most recent call last)
<ipython-input-7-26c24345ae23> in <module>()
----> 1 es.delete(index='para', doc_type='people')

C:\Users\Farid ullah\Anaconda3\lib\site-packages\elasticsearch\client\utils.py in _wrapped(*args, **kwargs)
     71                 if p in kwargs:
     72                     params[p] = kwargs.pop(p)
---> 73             return func(*args, params=params, **kwargs)
     74         return _wrapped
     75     return _wrapper

TypeError: delete() missing 1 required positional argument: 'id'

Can I not be able to delete entire index? Is there any way to delete it without specifying the id of a particular one?

1 Answer 1

3

In your case, 'people' is not an index, it's a type. The index name is 'para'. I don't know the python API, but your should try something like :

es.delete(index='para')

In this doc : http://elasticsearch-py.readthedocs.io/en/master/api.html

It is suggested to use something like :

es.indices.delete(index='para')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.