Hi,
I have a place model that it has hours for week day as you see in below, Now I want to write a query to get places that open now (pass hour and minute as separate parameters to query), but don't know how to write a advanced nested query with json and not plugin framework.
Anyone can help me?
{
"_index" : "places",
"_type" : "place",
"_id" : "15a12fg690t81p",
"_score" : 1.0,
"_source" : {
"id" : "15a12fg690t81p",
"name" : "fast-food",
"hours" : [
{
"day" : 0,
"is_overnight" : false,
"start" : "08:00",
"end" : "22:00"
},
{
"day" : 1,
"is_overnight" : false,
"start" : "08:00",
"end" : "22:00"
},
{
"day" : 2,
"is_overnight" : false,
"start" : "08:00",
"end" : "22:00"
},
{
"day" : 3,
"is_overnight" : false,
"start" : "08:00",
"end" : "22:00"
},
{
"day" : 4,
"is_overnight" : false,
"start" : "08:00",
"end" : "22:00"
},
{
"day" : 5,
"is_overnight" : false,
"start" : "08:00",
"end" : "18:00"
}
]
}
}