unable to search child object fields in azure search services(documentdb)?

回眸只為那壹抹淺笑 提交于 2019-12-10 12:19:29

问题


I am very new to azure search, basically i have created database and one collection this collection have few documents, also i have created one index .

I am using REST API to search documents, 1) my rest api service is given below.

 GET  https://xxxx.search.windows.net/indexes/[xxx]/docs?search=xxx&searchFields=xxxx&api-version=2015-02-28

2) My document is:{ "abc":"abcvalue", "xyz": { "key":"value", "kay1":"value1" }
}

Search result out put is : { "@odata.context": "https://xxx.search.windows.net/indexes('xxx')/$metadata#docs(id,key,key1)", "value": [ { "@search.score": 1, "id": "ccc485a8-18ea-8f06-9582-80a35ee9c567", "key": null, "key1": null }, { "@search.score": 1, "id": "bad34bb1-ed9a-bfb9-46e9-be97ac52680c", "key": null, "key1": null } }

but we are unable to search child object(xyz) fileds, where iam missing can you any one suggest me are any links

Thanks.


回答1:


In short, an Azure Search index can only have flattened documents at this time. This means you will need to take the hierarchical data in your DocumentDB and flatten it out in Azure Search. There's a really great article that discusses flattening your data here.

I hope this info helps,

Chad Campbell

Author of Adding Search Abilities to your Apps with Azure Search



来源:https://stackoverflow.com/questions/39634568/unable-to-search-child-object-fields-in-azure-search-servicesdocumentdb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!