I have a items with below structure
{
"user_id" : "unique id for the user",
"minutes": {
"2019-1-11T14:41:00.000Z": {
"interest_1" : {
"count" : 2,
"obs" : [
"req_id_1","req_id_2"
]
},
"date" : "2019-1-11T14:41:00.000Z"
},
"2019-1-15T12:18:00.000Z": {
"interest_1" : {
"count" : 1,
"obs" : [
"req_id_3"
]
},
"interest_2" : {
"count" : 1,
"obs" : [
"req_id_4"
]
},
"date" : "2019-1-15T12:18:00.000Z"
},
"2019-1-15T13:27:00.000Z": {
"interest_1" : {
"count" : 3,
"obs" : [
"req_id_5","req_id_6","req_id_7"
]
},
"date" : "2019-1-15T13:27:00.000Z"
},
"2019-1-15T20:30:00.000Z": {
"interest_2" : {
"count" : 1,
"obs" : [
"req_id_8"
]
},
"date" : "2019-1-15T20:30:00.000Z"
}
}
}
I want to get all users with interest count and observations from a list of interests between a time interval.
For example, i want all users with interest interest_1 between time 2019-1-15T12:00:00.000Z and 2019-1-15T14:00:00.000Z
I am using this structure to track time series event of the user. I know elasticsearch allow inner objects query but we have to know the whole path to inner object from root object. But in my case, i cannot say the parent object key.
What will be the query to get my result or is there any other good method to track time series?