0

Given below is my UJSON (Ultra JSON) object of the index which I want to delete from ElasticSeach

{
u'_type': u'ratings', 
u'_source': {
            u'foo': u'fookey',
            u'bar': u'barvalue',
            u'fu': u'fuvalue',
            },
u'_index': u'fubar',
u'_version': 1,
u'found': True,
u'_id': u'fubarId'
}

I want to delete this index by passing the id "fubarId".Kindly provide me the query to delete it from Terminal

Note : I am using UJSON to store and retrieve

Prem
  • 630
  • 2
  • 11
  • 25
  • In the ES terminology, an "index" is a store of "documents". Do you want to delete the full index (i.e. with all documents it contains) or only a single document? – Val Jul 23 '15 at 06:55
  • I want to remove only the above index with particular ID – Prem Jul 23 '15 at 06:57
  • An index doesn't have an id, documents have ids. So I gather you want to delete a single document. – Val Jul 23 '15 at 06:58

1 Answers1

1

You can delete a single document using the Delete API:

curl -XDELETE localhost:9200/index/type/docId

In your case above, you would use this:

curl -XDELETE localhost:9200/fubar/ratings/fubarId
Val
  • 207,596
  • 13
  • 358
  • 360