The mapping:
"working_hour": {
"type": "nested",
"properties": {
"from": {
"type": "long"
}
}
}
Data example:
Record 1:
"_source" : {
"working_hour" : [
{
"from" : 3
},
{
"from" : 6
}
]
}
record 2:
"_source" : {
"working_hour" : [
{
"from" : 6
},
{
"from" : 6
}
]
}
query:
"query": {
"bool": {
"must": [
{
"nested": {
"path": "working_hour",
"query": {
"range": {
"working_hour.from": {
"gte": 5,
"lte": 7
}
}
}
}
}
]
}
}
My expected result only "record 2" will be returned. However, record 1 and record 2 return. How can I create a query?