Hi all!
I found an issue when I try to filter documents by range where second parameter is Long.MAX_VALUE
.
For example, let's create a schema of the document:
PUT /example
{
"mappings": {
"_doc": {
"properties": {
"order": {
"type": "date",
"format": "epoch_millis",
"store": true
}
}
}
}
}
Than add document:
PUT /example/_doc/1
{
"order": 1568705332742
}
When I execute the query:
POST /example/_search
{
"query":{
"bool":{
"filter":[
{
"range":{
"order":{
"gte":0,
"lte":9223372036854775807
}
}
}
]
}
}
}
I expect to receive added document, but I receive an empty list.
If I just remove one digit and replace 9223372036854775807
to 922337203685477580
query works.
9223372036854775807
is a 2^63-1
. I'm using Java's Long.MAX_VALUE.
According to docs, date is storing as a long internally and long is a signed 64-bit integer with a minimum value of -2^63
and a maximum value of 2^63-1
.
Any ideas how to solve it?
Thanks in advance,
Vova