Exists query on numeric attributes with null_value gives unexpected result


(Amit Azulay) #1

Hi all,
I'm working with elastic 6.2.4.
my index-mapping contains "null_value".

I've notice that exists query gives different result when working with numeric value.

example:

PUT person { "mappings": { "_doc": { "properties": { "nickname": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256, "null_value": "null" } } }, "grade":{ "type":"double", "null_value": -1 } } } } }

POST /person/_doc/1 { "name":"David", "nickname":null, "grade":null }

GET person/_search { "size": 0 , "query": { "exists":{ "field":"grade" } } }

gives unexpected result > hits.total: 1.

where

GET person/_search { "size": 0 , "query": { "exists":{ "field":"nickname" } } }

gives expected result > hits.total: 0.

I think it's a BUG.


(system) #2

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