2016-08-23 60 views
0

我已請求在Azure搜索服務之後以下JSON結構(使用搜索= *)平數據:天青搜索:從集(Edm.String)

"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}" 
      ] 
     } 

欲內的類別,如描述搜索= C1但我不能。我試圖使用$ filter/categories.any(t:t eq'C1'),但不起作用。

回答

1

不幸的是Azure Search還不支持這種複雜的數據類型。我會說這是top requested feature,所以它在我們的清單中很受支持,但是我們需要一段時間才能實現。

與此同時,您可能想要查找的一些內容是查看是否有選項來平整文檔。例如,在您的Azure搜索索引中創建一個名爲categoriesDescription的字段和另一個名爲categoriesId的集合類型(基本上是一個字符串數組)的字段是否現實?

例如,也許你將有categoriesDescription包含[ 「C1」, 「C2]和categoriesID包含[」 3" , 「4」]

柯克·埃文斯做了一個nice blog post也涵蓋的話題壓扁JSON文件,如果我分裂類別categoriesDescription和categoriesID我可以做一個小處理這些信息你可能會發現有用的。

利亞姆

+0

? –