I created an index
curl -XPUT 'http://localhost:9200/tipindex/' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 1,
}
}
}
}'
and then I associated a river with the index using the following command :
curl -XPUT "localhost:9200/_river/tipindex/_meta" -d '
{
"type": "mongodb",
"mongodb": {
"host": "<machine-name>",
"port": "27017",
"db": "mydb",
"collection": "tips"
},
"index": {
"name": "tipindex",
"type": "tips"
}
}'
The index is properly created and all the documents are indexed. However, if I delete the index using :
curl -XDELETE '<machine-name>:9200/tipindex/'
It completes with {"ok":true,"acknowledged":true}
ES log : [tipindex] deleting index
Now if I execute curl -XDELETE 'localhost:9200/tipindex/'
{"error":"IndexMissingException[[tipindex] missing]","status":404}
which means that index is deleted.
But if I restart elasticsearch the index is created again with 0 documents and no mapping.
If I recreate the index and associate a river, then no documents are indexed. ES log do not show any error as well.
Now my questions are :
- Why is the index not getting deleted ?
- When I recreate the index,why are the documents not getting indexed again?
- How can I delete an index forcefully?