Reindex Data

Hello,

I'm trying to use the /_reindex API with elasticsearch 5.0.0-alpha1 and
with the query:

POST /_reindex
{
  "source": {
    "index": "existing_index"
  },
  "dest": {
    "index": "new_index"
  }
}

I get:

{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "unknown setting [index.dest.index]"
}
],
"type": "illegal_argument_exception",
"reason": "unknown setting [index.dest.index]"
},
"status": 400
}

What should I do?

Thank you!

1 Like

I believe you haven't installed the reindex module. This comes by default if you use Elasticsearch in the tar, zip, rpm, or deb distribution. Usually I see this problem when folks try to run Elasticsearch embedded which isn't supported.

This error message is because without the plugin installed POST /_reindex looks a request to create an index.

We really should treat APIs that start with _ like that as 404s rather than index creations....

1 Like

I installed Elasticsearch with yum install elasticsearch with a repository:

$ sudo cat /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=http://packages.elastic.co/elasticsearch/5.x/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1

(I folowed the tutorial below and then I updated my repository and did a yum update)

Can I install the plugin afterwards?

Thank you!

In fact, from what I see there is no reindex module in 5.0.0-alpha1
https://maven-repository.com/artifact/org.elasticsearch/elasticsearch/5.0.0-alpha1
but there is one in alpha5
https://maven-repository.com/artifact/org.elasticsearch/elasticsearch/5.0.0-alpha5

..

Thank you!

I think that is a maven packaging problem we had in early 5.0 alphas.

Do you see a reindex directory in Elasticsearch's modules directory?

No, I have nothing in the module directory...

Yeah, so you don't have reindex installed. I don't know why you don't have reindex installed. It certainly comes with the rpm. Can you check if installing encountered an error somehow? Maybe removing and reinstalling?

I don't want to loose my indexed data.. is there a way to remove and reinstall wihout loosing my data?

I did a yum update and yum downgrade, now I have the reindex directory in the modules.

I have another problem, that it takes 2 hours to start after a restart (Elasticsearch is taking 2 hours to resart), so I cannot check if it really works only in 2 hours..

Thank you for your help!

Hello, so now I have another error when I use the _reindex API...

POST /_reindex
{
  "source": {
    "index": "existing_index"
  },
  "dest": {
    "index": "new_index",
    "version_type": "external",
    "op_type": "create"
  }
}

But I get an error

>  {
>          "index": "new_index",
>          "type": "my_type",
>          "id": "for each ID",
>          "cause": {
>             "type": "index_not_found_exception",
>             "reason": "no such index",
>             "index_uuid": "aifLzvTLTwmwSH2NbNWE4w",
>             "index": "new_index"
>          },
>          "status": 404
>       }

I tried to create the new_index by myself before calling this API..bu no results..

Thank you!

Do you happen to have action.auto_create_index set to false? What do you mean by no response? What did you send to create the index?