# Unable to view attributes of nested json object

**URL:** <https://discuss.elastic.co/t/unable-to-view-attributes-of-nested-json-object/100035>\
**Category:** Elasticsearch\
**Created:** [September 11, 2017, 11:02am UTC](https://discuss.elastic.co/t/unable-to-view-attributes-of-nested-json-object/100035 "2017-09-11T11:02:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NehaD](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NehaD](https://discuss.elastic.co/u/NehaD)\
**Post date:** [September 11, 2017, 11:02am UTC](https://discuss.elastic.co/t/unable-to-view-attributes-of-nested-json-object/100035/1 "2017-09-11T11:02:48Z")

</div>

Hi,

I have an Object hierarchy like below :  
Class Findings {  
int ...;  
String ...;  
ArraList matches ...;  
}

Class Matches {  
int.. ;  
String...;  
String ...;  
}

i.e. One Finding object can have list of Matches object. Both the object implement serializable.  
After creating index for the above structure, when i try to query the data indexed using get() API, I can see the attributes of "Findings" Object correctly , except however the "Matches" reference in that object appears as a Java instance reference and not the actual list of "Matches" with their values.

{  
"\_index": "test\_java",  
"\_type": "java",  
"\_id": "AV5wY2dipQ3FPotqiQGr",  
"\_version": 1,  
"\_score": 1,  
"\_source": {  
"clientID": "123",  
"Matches": [  
"com.paasify.java.domain.Matches@4566e5bd"  
],  
"CriteriaId": 3,  
"GroupId": 1  
}  
}

How can we index such nested objects?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 11, 2017, 3:33pm UTC](https://discuss.elastic.co/t/unable-to-view-attributes-of-nested-json-object/100035/2 "2017-09-11T15:33:36Z")

</div>

As you havent specified any further technical details, the only thing one can extract from this, is that you have to configure your object mapper properly, so it serializes the `Matches` class properly instead of just using the `toString()` representation. A look at the documentation of that JSON serialization tool is your next step. All of this happens before any data is actually sent to Elasticsearch.

Hope this helps!

--Alex

---

<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:** [October 9, 2017, 3:33pm UTC](https://discuss.elastic.co/t/unable-to-view-attributes-of-nested-json-object/100035/3 "2017-10-09T15:33:42Z")

</div>

Closed on October 9, 2017, 3:33pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
