Reputation: 283
I have the following JSON structure after request the Azure search service (using search=*):
"value": [
{
"@search.score": 1,
"id": "160",
"title": "title1",
"description": "description",
"address": "Ranelagh Gardens, London, SW6 3PR, UK",
"categories": [
"{\r\n \"description\": \"C1\",\r\n \"id\": \"3\"\r\n}",
"{\r\n \"description\": \"C2\",\r\n \"id\": \"4\"\r\n}"
]
}
I want to search inside categories such as description=C1 but I can't. I tried to use $filter/categories.any(t:t eq 'C1') but isn't working.
Upvotes: 0
Views: 1116
Reputation: 1464
Unfortunately Azure Search does not yet support complex data types such as this. I will say that this is the top requested feature, so it is high on our list to support, but it will take us some time to get this implemented.
In the meantime, some of the things you might want to look in to is to see if there is an option to flatten your documents. For example, is it realistic to create a field in your Azure Search index that is say called categoriesDescription and another one called categoriesId that are both a collection type (basically an array of strings)?
For example, perhaps you would have the categoriesDescription contain ["C1", "C2] and categoriesID contain ["3", "4"]?
Kirk Evans did a nice blog post that also covers the topic of flattening JSON documents that you might find helpful.
Liam
Upvotes: 1