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

Phrase suggester throws ArrayIndexOutOfBoundsException when stopwords are the only text values #2817

Closed
tteats opened this issue Mar 26, 2013 · 1 comment
Assignees

Comments

@tteats
Copy link

tteats commented Mar 26, 2013

-Version 0.90.0.RC1
When searching for phrase suggestions and all suggestions are stop words, then I would expect empty results instead of an ArrayIndexOutOfBoundsException.

curl -XPUT http://localhost:9200/test -d '{ "number_of_shards":1, "number_of_replicas":0 }'
curl -XPUT http://localhost:9200/test/test/1 -d '{ "subject": "a test subject" }'
curl -XPOST http://localhost:9200/test/_suggest?pretty=true -d '{
  "text": "a an the",
  "sug2": {
    "phrase": {
      "field": "subject",
      "size": 1,
      "real_word_error_likelihood": 0.95,
      "max_errors": 0.5,
      "gram_size": 2,
      "direct_generator": [
        {
          "field": "subject",
          "suggest_mode": "always",
          "min_word_len": 1
        }
      ]
    }
  }
}'

# Response
{
  "_shards" : {
    "total" : 1,
    "successful" : 0,
    "failed" : 1,
    "failures" : [ {
      "index" : "test",
      "shard" : 0,
      "reason" : "BroadcastShardOperationFailedException[[test][0] ]; nested: ElasticSearchException[failed to execute suggest]; nested: ArrayIndexOutOfBoundsException[0]; "
    } ]
  }
}
@ghost ghost assigned s1monw Mar 26, 2013
@s1monw
Copy link
Contributor

s1monw commented Mar 26, 2013

argh! thanks for opening this issue. I will fix soon.

@s1monw s1monw closed this as completed in 17f83f3 Mar 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants