我有一个elasticsearch查询结果迭代通过elasticsearch文件的数组,并打印出来
“强”:{
“命中”:{
“总”:21” MAX_SCORE “:2.2237754,
”命中“:[{” _索引 “:” automatch_testing”, “_类型”: “temp_135”, “_ ID”: “AVU7i0nnXK6g_oqHu-AZ”, “_分数”:2.2237754, “_源” :{“t_pacs_id”:“34”,“t_id”:“60”,“匹配”:“MO”}},
{“_index”:“automatch_testing”,“_ type”:“temp_143”,“_id”:“AVU7iOSeXK6g_oqHu-XY”,“_ score”:2.2237754,“_ source”:{“t_pacs_id”:“30” t_id“:”60“,”matching“:”MO“,”t_match“:”matched“}},
{”_index“:”automatch_testing“,”_ type“:”temp_135“,”_ id“ “AVU7i0nlXK6g_oqHu-AY”, “_分数”:2.2237754, “_源”:{ “t_pacs_id”: “28”, “T_ID”: “60”, “匹配”: “MO”, “UICriteria”: “135”,” t_match“:”matched“}}]}}}
我想打印每个命中的源...”命中“是控制器返回的结果。
我想是这样......但似乎没有工作
<div ng-repeat="hit in hits.tops.hits.hits">
<td > {{ rhit._source.t_pacs_id }}</td>
</div>
但是这个代码的工作...打印出数组的第一个元素的源
<p> {{ hits.tops.hits.hits[0]._source }} </p>
是否有任何方法遍历所有数组元素并打印它们?