Hello lad
Hello lad

Reputation: 18790

Elasticsearch _reindex fails

I am working on AWS Elasticsearch. It doesn't allow open/close index, so setting change can not be applied on the index.

In order to change the setting of a index, I have to create a new index with new setting and then move the data from the old index into new one.

So first I created a new index with

PUT new_index
{
  "settings": {
    "max_result_window":3000000,
    "analysis": {
      "filter": {
        "german_stop": {
          "type":       "stop",
          "stopwords":  "_german_"
        },
        "german_keywords": {
          "type":       "keyword_marker",
          "keywords":   ["whatever"]
        },
        "german_stemmer": {
          "type":       "stemmer",
          "language":   "light_german"
        }
      },
      "analyzer": {
        "my_german_analyzer": {
          "tokenizer":  "standard",
          "filter": [
            "lowercase",
            "german_stop",
            "german_keywords",
            "german_normalization",
            "german_stemmer"
          ]
        }
      }
    }
  }
}

it succeeded. Then I try to move data from old index into new one with query:

POST _reindex
{
  "source": {
    "index": "old_index" 
  },
  "dest": {
    "index": "new_index"
  }
}

It failed with

Request failed to get to the server (status code: 504)

I checked the indices with _cat api, it gives

health status index          uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   old_index      AGj8WN_RRvOwrajKhDrbPw   5   1    2256482       767034      7.8gb          7.8gb
yellow open   new_index      WnGZ3GsUSR-WLKggp7Brjg   5   1      52000            0    110.2mb        110.2mb

Seemingly some data are loaded into there, just wondering why the _reindex doesn't work.

Upvotes: 2

Views: 2199

Answers (1)

Zubair
Zubair

Reputation: 6233

You can check the status of reindex with api:

GET _tasks?detailed=true&actions=*reindex

There is a "status" object in response which has field "total":

total is the total number of operations that the reindex expects to perform. You can estimate the progress by adding the updated, created, and deleted fields. The request will finish when their sum is equal to the total field.

Link to ES Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html

Upvotes: 1

Related Questions