Json below (only _source
part is shown) is for example purpose only is shows an document from a fictional real estate broker
Question: how do i query this document if it has lots with ownerId: "Jim Anderson"
{
.
.
.
"_source": {
"city": {
"district10": [
{ "landlot1": {
"price": 50,
"size": 5,
"ownerId": "Jim Anderson"
}
},
{
"landlot2": {
"price": 45,
"size": 9,
"ownerId": "Anna Simson"
}
}
]
}
}
}
I tried something like this but didnt work
{
"query": {
"match": {
"city.district10.landlot1.ownerId" : "Jim Anderson"
}
}
}
How to make this work?