How to search for a single object of array with 2 must

i am trying to get result with conditions that matched single object of an array for example
1-find tag truck whose color is red
suppose to return the whole object,
2- find a tag truck whose color is pink
suppose to return nothing

{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 10.000583,
"hits": [
{
"_index": "atun",
"_type": "log-test",
"_id": "AWiy9lASsFWHgqVusudO",
"_score": 10.000583,
"_source": {
"user_id": "5c488a774b230e00b235a592",
"job_id": "5c56b8454b230e49d192d460",
"timestamp": 1549187292,
"plugin_name": "5c4d61cb4b230e02f77d24e0",
"plugin_output": {
"chunk_index": 0,
"id": 6,
"attributes": [
{
"tag": "person",
"color": [
"Black",
"Pink",
"blue"
],
"size": [
2000,
4000
],
"time": [
7,
150
],
"speed": 15
},
{
"tag": "truck",
"color": [
"Blue",
"red"
],
"size": [
8000,
10000
],
"time": [
7,
150
],
"speed": 50
}
]
},
"input_source": "5c4d62064b230e02f77d24e2",
"frame_number": 3401,
"frame_path": "27c3864e-d180-42d2-add1-6699566a6997_1549187334.png"
}
},
{
"_index": "atun",
"_type": "log-test",
"_id": "AWizCW7IsFWHgqVusudQ",
"_score": 10.000583,
"_source": {
"user_id": "5c488a774b230e00b235a592",
"job_id": "5c56b8454b230e49d192d460",
"timestamp": 1549187292,
"plugin_name": "5c4d61cb4b230e02f77d24e0",
"plugin_output": {
"chunk_index": 1,
"id": 0,
"attributes": [
{
"tag": "person",
"color": [
"Black",
"Pink",
"blue"
],
"size": [
2000,
4000
],
"time": [
7,
150
],
"speed": 15
},
{
"tag": "truck",
"color": [
"Blue",
"red"
],
"size": [
8000,
10000
],
"time": [
7,
150
],
"speed": 50
}
]
},
"input_source": "5c4d62064b230e02f77d24e2",
"frame_number": 3401,
"frame_path": "27c3864e-d180-42d2-add1-6699566a6997_1549187334.png"
}
}
]
}
}

Thanks and best regards

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.