How to update a document using an index alias

I created the index "index-000001" with primary fragments = 5 and replica = 1. And I created two aliases

  • alias-read → index-000001
  • alias-write → index-000001

for indexing and searching. When I do a rollover of aliases when I reach maximum capacity, it creates a new "index-000002" and updates the aliases as

  • alias-read -> index-000001 and index-000002
  • alias-write → index-000002

How to update / delete a document existing in index-000001 (what if all I know is the identifier of the document but does not contain the index in which the document is located)?

thank

+4
source share
1 answer

, . , .

GET alias-read/{type}/{doc_id} , doc_id .

doc_id , id

GET alias-read/_search
{
   "term" : { "field" : "value" }
}

.

, "_index", .

PUT {index_name}/{type}/{id} {
    "required_field" : "new_value"
}

.

+1

Source: https://habr.com/ru/post/1678902/


All Articles