无法在azure搜索服务(documentdb)中搜索子对象字段? [英] unable to search child object fields in azure search services(documentdb)?

查看:48
本文介绍了无法在azure搜索服务(documentdb)中搜索子对象字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对天蓝色搜索非常陌生,基本上我已经创建了数据库,并且该集合中的一个集合包含很少的文档,而且我还创建了一个索引.

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 .

我正在使用REST API搜索文档, 1)我的rest api服务在下面提供.

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)我的文档是:{ "abc":"abcvalue", "xyz":{ 核心价值", "kay1":"value1" }
}

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

输出的搜索结果是: { "@ odata.context":" https://xxx.search.windows.net/indexes ('xxx')/$ metadata#docs(id,key,key1), 价值": [ { "@ 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 } }

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

但是我们无法搜索子对象(xyz)的文件,我遗失在哪里,你能不能建议我是任何链接

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

谢谢.

推荐答案

简而言之,Azure搜索索引此时只能具有扁平化的文档.这意味着您将需要在DocumentDB中获取分层数据,并在Azure搜索中将其展平.有一篇很棒的文章讨论了展平您的数据这里.

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,

乍得·坎贝尔

将搜索功能添加到您的带有Azure搜索的应用程序

这篇关于无法在azure搜索服务(documentdb)中搜索子对象字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆