Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting default similarity of index to default makes index unusable #24770

Closed
grmblfrz opened this issue May 18, 2017 · 1 comment
Closed

setting default similarity of index to default makes index unusable #24770

grmblfrz opened this issue May 18, 2017 · 1 comment

Comments

@grmblfrz
Copy link

grmblfrz commented May 18, 2017

Elasticsearch version: 5.4.0

Plugins installed: [analysis-icu, bundle, scoring-scripts (locally developed)]

JVM version (java -version):

openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-1~bpo8+1-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

OS version (uname -a if on a Unix-like system):
Linux 3.10.0 (in docker container)

Description of the problem including expected versus actual behavior:
I accidently set the default similarity of an index to 'default'. Now its impossible to open the index or change the faulty setting. It should be possible to recover from this mistake.
Steps to reproduce:

curl -XDELETE 'http://localhost:9200/similaritybug?pretty'
{ 
  "acknowledged" : true
}
curl -XPUT 'http://localhost:9200/similaritybug?pretty'
{ 
  "acknowledged" : true,
  "shards_acknowledged" : true
}
curl -XPOST 'http://localhost:9200/similaritybug/_close?pretty'
{ 
  "acknowledged" : true
}
curl -XPUT 'http://localhost:9200/similaritybug/_settings?pretty' -d '{ 
  "settings": { 
    "index": { 
      "similarity": { 
        "default": { 
          "type": "default" 
        } 
      } 
    } 
  } 
}'
{ 
  "acknowledged" : true
}
curl -XPOST 'http://localhost:9200/similaritybug/_open?pretty'
{ 
  "error" : {
    "root_cause" : [
      { 
        "type" : "exception",
        "reason" : "Failed to verify index [similaritybug/CvQX4fZRTwiLNPVqT8eHUg]"
      }
    ],
    "type" : "exception",
    "reason" : "Failed to verify index [similaritybug/CvQX4fZRTwiLNPVqT8eHUg]",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "Unknown Similarity type [default] for [default]"
    }
  },
  "status" : 500
}
curl -XPOST 'http://localhost:9200/similaritybug/_close?pretty'
{ 
  "acknowledged" : true
}
curl -XPUT http://localhost:9200/similaritybug/_settings\?pretty -d '{ 
  "settings": { 
    "index": { 
      "similarity": { 
        "default": { 
          "type": "BM25" 
        } 
      } 
    } 
  } 
}'
{ 
  "error" : {
    "root_cause" : [
      { 
        "type" : "illegal_argument_exception",
        "reason" : "Unknown Similarity type [default] for [default]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Unknown Similarity type [default] for [default]"
  },
  "status" : 400
}
curl -XPOST 'http://localhost:9200/similaritybug/_open?pretty'
{ 
  "error" : {
    "root_cause" : [
      { 
        "type" : "exception",
        "reason" : "Failed to verify index [similaritybug/CvQX4fZRTwiLNPVqT8eHUg]"
      }
    ],
    "type" : "exception",
    "reason" : "Failed to verify index [similaritybug/CvQX4fZRTwiLNPVqT8eHUg]",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "Unknown Similarity type [default] for [default]"
    }
  },
  "status" : 500
}
@jimczi
Copy link
Contributor

jimczi commented May 18, 2017

@grmblfrz this is a bug indeed.
The settings update should have failed the first time. This is fixed in 5.4.1 (the next bugfix release of 5.4):
#24487

@jimczi jimczi closed this as completed May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants