# JS Client not returning results

**URL:** <https://discuss.elastic.co/t/js-client-not-returning-results/44374>\
**Category:** Elasticsearch\
**Created:** [March 14, 2016, 10:37pm UTC](https://discuss.elastic.co/t/js-client-not-returning-results/44374 "2016-03-14T22:37:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivek\_rai](https://avatars.discourse-cdn.com/v4/letter/v/57b2e6/32.png) [@Vivek\_rai](https://discuss.elastic.co/u/Vivek_rai)\
**Post date:** [March 14, 2016, 10:37pm UTC](https://discuss.elastic.co/t/js-client-not-returning-results/44374/1 "2016-03-14T22:37:30Z")

</div>

# Hi, I have the following structure in the elasticSearch -- When i perform search by dbEntityName i get results , however when i perform search by legacyEntityAttributeName i do not get results , please note that kibana give me details , however my elasticSearch js client does not give me results

# sample code : $scope.search = function() { alert($scope.queryTerm); client.search({ index: 'legacytables', type: 'existingtables', body: { "query" : { "match" : {legacyEntityAttributeName: $scope.queryTerm} // if i give entityAttributes.legacyEntityAttributeName angular throws error } } }).then(function (resp) { alert(resp.hits.total); $scope.results = resp.hits.hits[0].\_source; }, function (err) { console.trace(err.message); }

[  
{  
"\_index": "legacytables",  
"\_type": "existingtables",  
"\_id": "AVNC54hNO04QfeJDGYBX",  
"\_score": 3.9704144,  
"\_source": {  
"dbEntityName": "TAAGENT\_REMARK",  
"otherEntityName": [  
"pc\_account",  
"pc\_note",  
""  
],  
"entityAttributes": [  
{  
"legacyEntityAttributeName": "HOUSEHOLD\_NUM",  
"legacydataType": "CHAR",  
"legacydatalength": "10.0",  
"legacydataDefinition": "A unique system generated number which is used to identify a specific household.",  
"legacydataClassification": "",  
"dataTeamReviewComments": "",  
"functionalTeamReviewComments": "",  
"xmlTag": "",  
"mappingLastUpdatedDate": "",  
"mappingLastUpdatedBy": "",  
"gwentityAttributeName": "AccountNumber",  
"gwtableName": "pc\_account",  
"gwdataType": "Varchar(255)",  
"gwdatalength": "Varchar(255)",  
"mappedBy": "",  
"mappedDate": "",  
"team": "",  
"gwdataDefinition": "The account number of this account. ",  
"gwdataClassification": ""  
}, \<!--- Repeats omitted for clarity\>\>  
]  
}  
} ]

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:08pm UTC](https://discuss.elastic.co/t/js-client-not-returning-results/44374/2 "2017-07-05T23:08:35Z")

</div>

Closed on July 5, 2017, 11:08pm UTC


