Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

i have the query result as follows...

{
   "took": 6,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },
   "hits": {
      "total": 45,
      "max_score": 0,
      "hits": []
   },
   "aggregations": {
      "by_id": {
         "doc_count_error_upper_bound": 0,
         "sum_other_doc_count": 0,
         "buckets": [
            {
               "key": "60",
               "doc_count": 21,
               "tops": {
                  "hits": {
                     "total": 21,
                     "max_score": 2.2237754,
                     "hits": [
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_135",
                           "_id": "AVU7i0nnXK6g_oqHu-az",
                           "_score": 2.2237754,
                           "_source": {
                              "t_pacs_id": "34",
                              "t_id": "60",
                              "matching": "MO",
                              "UICriteria": "135",
                              "t_match": "matched",
                              "t_criteria": "Accession Number;Patient Identifier;Last Name;Date of Birth;Sex;Modality"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_143",
                           "_id": "AVU7iOSeXK6g_oqHu-XY",
                           "_score": 2.2237754,
                           "_source": {
                              "t_pacs_id": "30",
                              "t_id": "60",
                              "matching": "MO",
                              "UICriteria": "143",
                              "t_match": "matched",
                              "t_criteria": "Accession Number;Patient Identifier;Last Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_135",
                           "_id": "AVU7i0nlXK6g_oqHu-ay",
                           "_score": 2.2237754,
                           "_source": {
                              "t_pacs_id": "28",
                              "t_id": "60",
                              "matching": "MO",
                              "UICriteria": "135",
                              "t_match": "matched",
                              "t_criteria": "Accession Number;Patient Identifier;Last Name;Date of Birth;Sex;Modality"
                           }
                        }
                     ]
                  }
               }
            },
            {
               "key": "12",
               "doc_count": 4,
               "tops": {
                  "hits": {
                     "total": 4,
                     "max_score": 2.2237754,
                     "hits": [
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_121",
                           "_id": "AVU9LoC9XK6g_oqHvAal",
                           "_score": 2.2237754,
                           "_source": {
                              "t_pacs_id": "778",
                              "t_id": "12",
                              "matching": "MO",
                              "UICriteria": "121",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_144",
                           "_id": "AVVTNXkQyjsrQd4jgajJ",
                           "_score": 2.098612,
                           "_source": {
                              "t_pacs_id": "654",
                              "t_id": "12",
                              "matching": "MO",
                              "UICriteria": "144",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_144",
                           "_id": "AVVTNXkOyjsrQd4jgajI",
                           "_score": 1.9007865,
                           "_source": {
                              "t_pacs_id": "778",
                              "t_id": "12",
                              "matching": "MO",
                              "UICriteria": "144",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        }
                     ]
                  }
               }
            },
            {
               "key": "22",
               "doc_count": 4,
               "tops": {
                  "hits": {
                     "total": 4,
                     "max_score": 2.098612,
                     "hits": [
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_144",
                           "_id": "AVVTNXkXyjsrQd4jgajM",
                           "_score": 2.098612,
                           "_source": {
                              "t_pacs_id": "778",
                              "t_id": "22",
                              "matching": "MO",
                              "UICriteria": "144",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_121",
                           "_id": "AVU9LoDLXK6g_oqHvAaq",
                           "_score": 1.9007865,
                           "_source": {
                              "t_pacs_id": "654",
                              "t_id": "22",
                              "matching": "MO",
                              "UICriteria": "121",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_144",
                           "_id": "AVVTNXkYyjsrQd4jgajN",
                           "_score": 1.8690379,
                           "_source": {
                              "t_pacs_id": "654",
                              "t_id": "22",
                              "matching": "MO",
                              "UICriteria": "144",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        }
                     ]
                  }
               }
            },
            {
               "key": "48",
               "doc_count": 4,
               "tops": {
                  "hits": {
                     "total": 4,
                     "max_score": 2.098612,
                     "hits": [
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_144",
                           "_id": "AVVTNXkGyjsrQd4jgajG",
                           "_score": 2.098612,
                           "_source": {
                              "t_pacs_id": "778",
                              "t_id": "48",
                              "matching": "MO",
                              "UICriteria": "144",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_121",
                           "_id": "AVU9LoCyXK6g_oqHvAaj",
                           "_score": 1.7621399,
                           "_source": {
                              "t_pacs_id": "778",
                              "t_id": "48",
                              "matching": "MO",
                              "UICriteria": "121",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_121",
                           "_id": "AVU9LoCzXK6g_oqHvAak",
                           "_score": 1.7621399,
                           "_source": {
                              "t_pacs_id": "654",
                              "t_id": "48",
                              "matching": "MO",
                              "UICriteria": "121",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        }
                     ]
                  }
               }
            },
            {
               "key": "83",
               "doc_count": 4,
               "tops": {
                  "hits": {
                     "total": 4,
                     "max_score": 2.098612,
                     "hits": [
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_121",
                           "_id": "AVU9LoDVXK6g_oqHvAas",
                           "_score": 2.098612,
                           "_source": {
                              "t_pacs_id": "654",
                              "t_id": "83",
                              "matching": "MO",
                              "UICriteria": "121",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_144",
                           "_id": "AVVTNXkeyjsrQd4jgajP",
                           "_score": 2.098612,
                           "_source": {
                              "t_pacs_id": "654",
                              "t_id": "83",
                              "matching": "MO",
                              "UICriteria": "144",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_121",
                           "_id": "AVU9LoDUXK6g_oqHvAar",
                           "_score": 1.8690379,
                           "_source": {
                              "t_pacs_id": "778",
                              "t_id": "83",
                              "matching": "MO",
                              "UICriteria": "121",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        }
                     ]
                  }
               }
            },
            {
               "key": "90",
               "doc_count": 4,
               "tops": {
                  "hits": {
                     "total": 4,
                     "max_score": 2.2237754,
                     "hits": [
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_144",
                           "_id": "AVVTNXj_yjsrQd4jgajE",
                           "_score": 2.2237754,
                           "_source": {
                              "t_pacs_id": "778",
                              "t_id": "90",
                              "matching": "MO",
                              "UICriteria": "144",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_121",
                           "_id": "AVU9LoCtXK6g_oqHvAai",
                           "_score": 2.098612,
                           "_source": {
                              "t_pacs_id": "654",
                              "t_id": "90",
                              "matching": "MO",
                              "UICriteria": "121",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_121",
                           "_id": "AVU9LoCrXK6g_oqHvAah",
                           "_score": 1.9007865,
                           "_source": {
                              "t_pacs_id": "778",
                              "t_id": "90",
                              "matching": "MO",
                              "UICriteria": "121",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        }
                     ]
                  }
               }
            },
            {
               "key": "945",
               "doc_count": 4,
               "tops": {
                  "hits": {
                     "total": 4,
                     "max_score": 1.9007865,
                     "hits": [
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_144",
                           "_id": "AVVTNXkTyjsrQd4jgajK",
                           "_score": 1.9007865,
                           "_source": {
                              "t_pacs_id": "778",
                              "t_id": "945",
                              "matching": "MO",
                              "UICriteria": "144",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_121",
                           "_id": "AVU9LoDEXK6g_oqHvAao",
                           "_score": 1.8690379,
                           "_source": {
                              "t_pacs_id": "654",
                              "t_id": "945",
                              "matching": "MO",
                              "UICriteria": "121",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        },
                        {
                           "_index": "automatch_testing",
                           "_type": "temp_144",
                           "_id": "AVVTNXkUyjsrQd4jgajL",
                           "_score": 1.8690379,
                           "_source": {
                              "t_pacs_id": "654",
                              "t_id": "945",
                              "matching": "MO",
                              "UICriteria": "144",
                              "t_match": "matched",
                              "t_criteria": "Middle Name"
                           }
                        }
                     ]
                  }
               }
            }
         ]
      }
   }
}

i want to display a table like for each "key" all the documents under that key is printed... the first result would be

_________________________
key       |  t_pacs_id
_________________________
60        |    34
          |    30
          |    28
-------------------------
12        |    778
          |    654

i have this code plunkr

but the code only prints the "key" not the "t_pacs_id"...is it possible to do this?? if so please suggest.

many thanks.

share|improve this question
    
is console.log($scope.fhits); logging? – adolfosrs Jun 23 at 14:32
    
Your sample json is not correct.Please paste right one – R.J Jun 23 at 14:35
    
i updated the ques – Nihal Pratap Jun 23 at 14:39
    
fhits is displayed in the console – Nihal Pratap Jun 23 at 14:41
up vote 0 down vote accepted

Replacing:

      <tr ng-repeat="hit in fhits">             
          <td> {{ hit.key}} </td>
          -<div data-ng-repeat="i in range">
              <div ng-repeat="rhit in hit.tops.hits.hits">
                        <td > {{ rhit }} </td>
              </div>
          </div>
      </tr>

With:

      <tr ng-repeat="hit in fhits">

          <td> {{hit.key}} </td>

          <td>
            <div ng-repeat="hits in hit.tops.hits">
              <div ng-repeat="rhit in hits">
                {{rhit._source.t_pacs_id}}
              </div>
            </div>  
          </td>
      </tr>

Should give you what you are looking for.

Plunker

share|improve this answer
    
thanks a lot BGiggle it worked... – Nihal Pratap Jun 23 at 15:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.