Hi ,
I'm new to DSL query, I have a use case like 'find the id that DPS > 100 and it does increasing in 2018 <> compare to 2017.
[DATA]
ID DPS DATE
5 100 2017
5 110 2018
1 50 2018
1 60 2017
I try to use below query to get the 2017 result, but I have no idea how to compare and loop via the hit result that return from query. Any instruction / sample can help , please ? Thanks a lot
GET testing/_search
{
"query":{
"bool":{
"filter":{
"range": {
"date" : {
"gte" : "now-1y/y",
"lt" : "now/y"
}
}
},
"must" : {
"range" : {
"dps" : { "gte" : 100 }
}
},
"boost" : 1.0
}
}
}