Ivan Kurchenko
Ivan Kurchenko

Reputation: 4063

Elasticsearch score precision

My problem is:

There is an index in my Elasticsearch with a very sensitive field of the type double which I use for '_score' calculation. Firstly, when is store this value to an index, Elasticsearch cuts its value, but then I found an additional mapping parameter: precision_step, which resolves my problem with correct value storing. But I still have a problem with correct _score sensitivity, because Elasticsearch rounds it's value.

So, my question is:

How I can set some precision parameters (like precision_step) for result _score value?

Thanks in advance!

Upvotes: 2

Views: 663

Answers (1)

Mark Leighton Fisher
Mark Leighton Fisher

Reputation: 5703

A workaround would be to expand the range of the score. Let's say scores range to 0.0 to 10.0 -- you could multiply each score by a constant 100, thereby reducing the rounding errors (yielding a range of 0.0 to 1000.0). You have to experiment to find the right constant multiplier for your application.

Upvotes: 2

Related Questions