2

I want to update count field in the following doc for example. Please help

{
        "_index" : "test-object",
        "_type" : "data",
        "_id" : "2.5.179963",
        "_score" : 10.039009,
        "_source" : {
          "object_id" : "2.5.179963",
          "block_time" : "2022-04-09T13:16:32",
          "block_number" : 46975476,
          "parent" : "1.2.162932",
          "field_type" : "1.3.2",
          "count" : 57000,
          "maintenance_flag" : false
        }
      }

1 Answer 1

2

you can simply use the Update API as

POST <your-index>/_update/<your-doc-id>
{
    "doc": {
        "count": "" // provide the value which you want to update
    }
}
Sign up to request clarification or add additional context in comments.

4 Comments

It's not working "error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can't start with '_', found: [_update]"}] Elasticsearch version: 6.7.2
@Subo which Elasticsearch version you are using?
Version is 6.7.2
@Subo you need to pass _doc in the URL, see elastic.co/guide/en/elasticsearch/reference/6.8/… doc for Elasticsearch 6.8

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.