ES 7.4.0
Centos 7
ref github issue
I would like to do a scroll operation for some data with the sorting of the abs value of the diff between publishTime VS. current system time.
In my opinion, the scroll might be:
- find out and make a snapshot for the query conditions
- cache them by the sort formula
- return the data paged by size
but for this query, each time i query for scroll page by scroll id, es result has these 2 results:
- data with messed up sequence
- return the same data list
I think this issue should be caused by System.currentTimeMillis()
? I don't know, maybe ?
{
"query": {
"some filters"
},
"sort":[
{
"_script":{
"script":{
"inline":"Math.abs(doc['publishTime'] - System.currentTimeMillis())",
"lang":"painless"
},
"type":"number",
"order":"desc"
}
}
]
}