If you upgrade Elasticsearch from 0.20 to 0.90, any queries you previously made
using a front slash will fail with an error similar to:
1 2 3 4 5 6 7 8 9 10 11 |
|
If you’re like me, you’re thinking “but my query doesn’t have an EOF in it, it’s
valid JSON”, and you’d be right. Your query is still valid JSON, but it’s no
longer a valid Elasticsearch query.
When Elasticsearch moved from 0.20 to 0.90, they changed versions of Lucene as
well, going from 3 to 4. Under Lucene 4, a query with a slash in it is
interpreted as a regular expression. Your regular expression starts with the
slash, but if you only have one slash, it never ends, so you get the
Encountered: <EOF> after :
error.
You will need to convert your queries to escape out slashes. Thus, a 0.20 query
of:
1 2 3 4 5 6 7 |
|
…becomes this under Elasticsearch 0.90:
1 2 3 4 5 6 7 |
|
Note that this only affects queries; filters are seemingly unaffected.
This was raised in this Github issue.