【发布时间】:2020-11-10 11:53:39
【问题描述】:
文档结构如下
{
"sNo": 0,
"id": 31575378,
"title": "Sustained preventive chemotherapy",
"journal": "Infectious diseases of poverty",
"publ_date": "2019-10-03",
"species": "Human",
"drug": ["Allegra", "Citrizin"],
"symptom": ["Cold", "Cough", "Fatigue"]
}
当我尝试从文档中提取药物 json 属性时
<extract-document-data>
<extract-path>/drug</extract-path>
</extract-document-data>
我收到类似的回复
<search:extracted kind="array">{"drug":"Dolo"}, {"drug":"Crocin"}, {"drug":"Combiflame",{"symptom":"Fever"} {"symptom":"Body Pain"}{"symptom":"Fatiguue"}]</search:extracted>
而我正在寻找药物作为 json 数组的输出:
<search:extracted kind="array">[{"drug":["Dolo","Crocin","Combiflame"]}]</search:extracted>
【问题讨论】: