Hi, I was trying to filter docs by a json field called “rooms” in a table “hotel” as below:
[
{
“id”: 1,
“smoke”: 1,
“bed_sizes”: [
2,3,4
]
},
{
“id”: 2,
“smoke”: 0,
“bed_sizes”: [
1,2,3
]
}
]
Now I would like to filter hotels that both accepts smoke, and has a bed size of 2. A request as below is similar to what I want:
SELECT id, ANY(r.smoke = 1 AND ANY(r.bed_sizes) = 2 for r in rooms) AS r FROM hotel WHERE r = 1
But clearly this sql does not work. I have read through the manticore and sphinxQL document and found nothing that I can do. I would really appreciate If you can give some advices on above situation. Thanks
Thank you so much for the demo. I made the rooms field itself an json array with brackets [] at the start and end, which makes the filtering not working at all. Now it works perfectly