Exact match on large float

I have a field mapped as a float, which is currently storing very large numbers. When I try to search for an exact match on this field, I often end up with results which are not exact matches:

"query": {
	 "constant_score" : {
        "filter" : {
            "term": {
                 "myFloat":  -23463951**15141076975**

Give a result with myFloat = -2346395166282373000

I realise that as these being used like IDs they should probably be mapped as keyword (or at least long as they are all whole numbers), but given that they already exist as floats, is it possible to get exact matches on them?

The answer is no as those big numbers are internally cast to floats so it might happen that two different numbers resolve to the same float and therefore you get multiple matches.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.