# Arrays & SearchHit java API

**URL:** <https://discuss.elastic.co/t/arrays-searchhit-java-api/136095>\
**Category:** Elasticsearch\
**Created:** [June 15, 2018, 1:02pm UTC](https://discuss.elastic.co/t/arrays-searchhit-java-api/136095 "2018-06-15T13:02:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sureshvytla](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sureshvytla](https://discuss.elastic.co/u/sureshvytla)\
**Post date:** [June 15, 2018, 1:02pm UTC](https://discuss.elastic.co/t/arrays-searchhit-java-api/136095/1 "2018-06-15T13:02:13Z")

</div>

Hi, We are storing arrays in elastic search (5.4.x) with a naming convension of column, and would like to retrieve array values in search API. We are using SearchRequestBuilder and noticing the following error.

```
 {
 "error" : "Can not start an object, expecting field name (context: Object)"
 }

   "string_arrays": {
        "match": "*__sa",
        "match_mapping_type": "*",
        "mapping": {
          "type": "keyword",
          "doc_values": true,
          "index": "not_analyzed",
          "null_value": "[]"
       }
    }

```

The values that are persisted in ES can be retreived by document id, but fail to use SearchHit api.

The sample values in ES :

`columnName__sa : ["abc", "def", "ghi"]`

Please advice me on how to retreive column values in the search api.

Thanks,  
Suresh

---

<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 13, 2018, 1:02pm UTC](https://discuss.elastic.co/t/arrays-searchhit-java-api/136095/2 "2018-07-13T13:02:13Z")

</div>

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