Elasticsearch's Curl Delete

Source: Internet
Author: User

Extended,

Elasticsearch Curl Delete the index library

[[email protected] elasticsearch-2.4.3]$ Curl -xdelete ' HTTP://192.168.80.200:9200/ZHOULS/EMP/1 '
{"Found": true, "_index": "Zhouls", "_type": "EMP", "_id": "1", "_version": 5, "_shards": {"Total": 2, "successful": 1, " Failed ": 0}}[[email protected] elasticsearch-2.4.3]$
[Email protected] elasticsearch-2.4.3]$
[Email protected] elasticsearch-2.4.3]$
[Email protected] elasticsearch-2.4.3]$
[Email protected] elasticsearch-2.4.3]$ curl-xget ' Http://192.168.80.200:9200/zhouls/emp/1?pretty '
{
"_index": "Zhouls",
"_type": "EMP",
"_id": "1",
"Found": false
}
[Email protected] elasticsearch-2.4.3]$

[Email protected] elasticsearch-2.4.3]$ curl-xdelete ' HTTP://192.168.80.200:9200/ZHOULS/EMP/1 '
{"Found": false, "_index": "Zhouls", "_type": "EMP", "_id": "1", "_version":1, "_shards": {"Total": 2, " Successful ": 1," failed ": 0}}[[email protected] elasticsearch-2.4.3]$
[Email protected] elasticsearch-2.4.3]$
[Email protected] elasticsearch-2.4.3]$
[Email protected] elasticsearch-2.4.3]$ curl-xdelete ' HTTP://192.168.80.200:9200/ZHOULS/EMP/1 '
{"Found": false, "_index": "Zhouls", "_type": "EMP", "_id": "1", "_version":2, "_shards": {"Total": 2, " Successful ": 1," failed ": 0}}[[email protected] elasticsearch-2.4.3]$

The mechanism of ES, after the first deletion, after 60 seconds, executes the delete command, then version becomes 1 and begins to increase. (not to be surprised as to know)

ES Removal Operations Supplemental knowledge

  if the document exists , ES returns a status code of $ OK, and the found property value is the value of the True,_version property +1.

  if the document does not exist , ES returns a status code of 404 Not Found, the found property value is false, but the value of the _version attribute is still +1, which is part of the internal management It ensures that the order in which we operate between multiple nodes is correctly marked.

Note: Deleting a document does not take effect immediately, it is only marked as deleted. Elasticsearch will delete content cleanup in the background when you add more indexes later.

ES Delete Summary

The delete operation of ES is not immediately effective, similar to the update operation. It is only marked as deleted, and ES is automatically deleted later.

Like, you delete the operation step by step accumulation, when reaching its upper limit, when you delete dozens of data, es i delete once, this can save disk IO.

These simple es delete operations, easy in the production environment, manually entered. Complex, with Java code to implement.

Elasticsearch's Curl Delete

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.