elasticsearch/elasticsearch — Issue #1641: Highlighting broken after 0.18.5 when using CustomScoreQuery
Author: bjornlilja
Created: 2012-01-26 12:25:44+00:00
State: open

Hi

We are using Elasticsearch with pyes (0.16.0) and CustomScoreQuery. When upgrading from ES 0.18.5 to 0.18.6 or higher the highlighting beaks.

Example _broken_ query:

{"custom_score": {"query": {"bool": {"must": [{"query_string": {"fields": ["title", "text", "org_comments_text", "other_comments_text", "tags"], "query": "filmer"}}]}}, "script": "_score * (1 + (0.5 * min((max(7 - ((time() - doc['last_activity'].value)/(1000*60*60*24)), 0)), 1)*0.1) + (0.5 * min((max(30 - ((time() - doc['last_activity'].value)/(1000*60*60*24)), 0)), 1)*0.1) + (1.0 * min((max(90 - ((time() - doc['last_activity'].value)/(1000*60*60*24)), 0)), 1)*0.1) + (2 * min((max(180 - ((time() - doc['last_activity'].value)/(1000*60*60*24)), 0)), 1)*0.1))"}}

Example of _working_ query:
{"bool": {"must": [{"query_string": {"fields": ["title", "text", "org_comments_text", "other_comments_text", "tags"], "query": "kundo"}}]}}

When reading the changelog it appears as this fix could be the cause:
https://github.com/elasticsearch/elasticsearch/commit/be282cc4c8b44956be4ec98be73061ca3e25b73a

Issue #1314 from september 2011 raises the same issue, has it perhaps reappeared by the above fix?