小女子第一次使用elasticsearch,还有很多不明白的地方,比如
嵌套的json举例:
{
"hospital_id":1,
"departments":["内科","外科","妇科"],
"doctors":[{"name":"王思聪","position":"妇产科医生","advantage":"擅长妇产科" },{},{} ]
}
如何同时根据 json字段的departments的科室名称和doctors列表的advantage字段来进行查询,写一个DSL
嵌套的json举例:
{
"hospital_id":1,
"departments":["内科","外科","妇科"],
"doctors":[{"name":"王思聪","position":"妇产科医生","advantage":"擅长妇产科" },{},{} ]
}
如何同时根据 json字段的departments的科室名称和doctors列表的advantage字段来进行查询,写一个DSL
1 个回复
cyberdak
赞同来自: Backer
数组可以直接查询
嵌套json的话,需要设置doctors的mapping为nested