This is the index of my model in the elastic search
{
"_index":"cars",
"_type":"car",
"_id":"3275",
"_version":4,
"_score":1,
"_source":{
"category_id": 6,
"car_branches":[
{
"id":32,
"name":"Type1"
},
{
"id":33,
"name":"Type2"
},
{
"id":36,
"name":"Type3"
}
],
}
}
I can query category_id with
Car.__elasticsearch__.search query:{match:{category_id: 6}}
How do I query for car_branches? I tried this
response = Car.__elasticsearch__.search query:{match:{car_branches:[id: 32]}}
I am getting Elasticsearch::Transport::Transport::Errors::BadRequest: [400]