Avoid scientific notation of date values (epoch millis format) in queries since Elasticsearch is unable to parse it

Description

When we have a NumricRangeQuery against an indexed date field, GSON sometimes converts the min and max value to a long value with scientific notation. Elasticsearch is unable to parse that value and fails.
Hibernate Search should configure GSON in a way that it does not output a long with scientific notatation when it has a query against a date value.

We have indexed fields like this:

And build queries against those fields like this:

Hibernate Search builds the following JSON request out of this query:

Elasticsearch then fails with this error:

Tested with Elasticsearch 2.3.5 and 2.4.1

depends on

Activity

Show:

Yoann Rodière December 5, 2016 at 4:34 PM

The Jest PR has been approved and merged. Guillaume is reaching to the maintainer for a Jest release.

Guillaume Smet November 24, 2016 at 6:42 PM

Guillaume Smet November 24, 2016 at 10:11 AM

Yes, I contacted the Jest maintainers a few days ago and they are willing to merge PRs and make a new release.

The bad news is that the merged PR does not solve the scientific notation issue. I'm working on a new PR to fix the issue properly. I'll post the link here when I'm done.

Marco Perazzo November 23, 2016 at 2:31 PM

Hi, I saw the pull request was merged into the Jest master branch:
https://github.com/searchbox-io/Jest/pull/405
Maybe there is a new version of Jest coming soon including that fix.

Marco Perazzo November 14, 2016 at 11:00 AM

Thanks for the information.
As it seems we can't expect a quick resolution for this.

Fixed

Details

Assignee

Reporter

Components

Affects versions

Priority

Created November 11, 2016 at 9:40 AM
Updated December 19, 2016 at 10:48 PM
Resolved December 8, 2016 at 10:55 PM