Hi Guys,
I have a scenario, when queried for a keyword i have to return all the locations associated with that keyword in a single document.
Lets say,
#document 1
{
"bizzid": "1",
"bizzname": "Crazy Bakers",
"bizzLocation": [{
"locationType": "locality",
"name": "Bilekahalli"
}, {
"locationType": "City",
"name": "Bengaluru"
}, {
"locationType": "State",
"name": "Karnataka"
}],
"bizzCategory": [{
"name": "Party planners",
"categoryId": "10002"
}, {
"name": "Weddings",
"categoryId": "10023"
}]
}
#document 2
{
"bizzid": "2",
"bizzname": "AmsterData",
"bizzLocation": [{
"locationType": "locality",
"name": "Electronic City"
}, {
"locationType": "City",
"name": "Bengaluru"
}, {
"locationType": "State",
"name": "Karnataka"
}],
"bizzCategory": [{
"name": "Party planners",
"categoryId": "10002"
}, {
"name": "Weddings",
"categoryId": "10023"
}]
}
So when i query for "Party planners" the result should give me all the bizzlocation but in a single document, some thing like
{
"bizzLocation.name" : [ {"Bilekahalli", "Bengaluru", "Karnataka"},{"Electronic City","Bengaluru", "Karnataka"} ]
}
I dont know if its possible. Any help is much appreciated.