0

I cannot make head or tail of this error, and it's happening pretty randomly to where I don't even know where to start looking.

This is what the full error looks like

Tire::Search::SearchRequestFailed: 500 :

{
  "error": "SearchPhaseExecutionException[Failed to execute phase [query_fetch], total failure; 
            shardFailures {[7McitJnjQkqLkViqUpZUyw][content][4]: 
              FetchPhaseExecutionException[[content][4]: 
                query[+_all:account +_all:set +_all:up],from[0],size[20]: 
                Fetch Failed [Failed to highlight field [post_content]]]; 
                nested: StringIndexOutOfBoundsException[String index out of range: -5]; }]",
  "status": 500
}

A query like "relationship learning"

will run fine, but running "relationship centered learning"

will throw the error, actually any of these letters c, d, j, q, x, z used with "relationship learning" .. like "d relationship learning" will throw the error.

Its truly maddening.

I'm running elasticsearch 19.2 with Tire I just want to know where to start looking, any ideas will help.

This is a more complete explanation of the problem I'm having, it's exactly the same

Saeed Zhiany
  • 2,051
  • 9
  • 30
  • 41
concept47
  • 30,257
  • 12
  • 52
  • 74
  • It looks like a bug in fast vector highlighter. If you can upgrade to 0.20, you can try switching to standard highlighter by adding `"type":"highlighter"` attribute to the highlighter request to see if it will fix the issue. – imotov Apr 01 '13 at 21:45
  • Thanks imotov! Is there a fix you're aware of in ES that might have fixed this in 0.20.x or is it a lucene issue that was fixed in an upgrade in a version bump on ES? – concept47 Apr 01 '13 at 22:04
  • Not that I am aware of. What I am suggested is not a fix, it's workaround. You can achieve the same result by reindexing your records without term_vectors. By the way, can you post complete stacktrace for this error? – imotov Apr 01 '13 at 22:25
  • Here's a gist https://gist.github.com/ike-bloomfire/058639517390762fb389 – concept47 Apr 01 '13 at 22:49
  • You can achieve the same result by reindexing your records without term_vectors -----> that was causing another bug which I just managed to fix with this. http://stackoverflow.com/questions/13750330/elasticsearch-highlighting-on-ngram-filter-is-wierd-if-min-gram-is-set-to-1/15005321#15005321 – concept47 Apr 01 '13 at 22:53

1 Answers1

1

As @imotov said above, this is a bug in lucene and therefore elasticsearch, https://issues.apache.org/jira/browse/LUCENE-4899

You can resolve it by not using the fast vector highlighter, or by setting fragment_size to a higher number to reduce incidences of the bug appearing.

I doubt that they will go away completely unless you set fragment_size to an impossibly high number, which you could do (in theory, but then you'd have to handle truncation on your own, which kind of defeats the purpose of the highlighter in the first place)

concept47
  • 30,257
  • 12
  • 52
  • 74