# Scroll api and some parsing issues. (Python)

**URL:** <https://discuss.elastic.co/t/scroll-api-and-some-parsing-issues-python/179864>\
**Category:** Elasticsearch\
**Created:** [May 7, 2019, 1:21am UTC](https://discuss.elastic.co/t/scroll-api-and-some-parsing-issues-python/179864 "2019-05-07T01:21:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iukea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iukea/32/49083_2.png) [@iukea](https://discuss.elastic.co/u/iukea)\
**Post date:** [May 7, 2019, 1:21am UTC](https://discuss.elastic.co/t/scroll-api-and-some-parsing-issues-python/179864/1 "2019-05-07T01:21:34Z")

</div>

Hello,

I am trying to print out all the values listed of

- max\_score  
and

- mobile:

- home

From this JSON that came from elasticSearches scroll api.

````
```
{
  "took": 3,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 2,
    "max_score": 1.0,
    "hits": [
      {
        "_index": "contacts",
        "_type": "index",
        "_id": "2",
        "_score": 1.0,
        "_source": {
          "id": "c201",
          "name": "Johnny Depp",
          "phone": {
            "mobile": "+91 0000000000",
            "home": "00 000000"
          }
        }
      }
    ]
  }
}
```

````

my python code to print out

```
for hits in res:
  #print hits
    print(hits["max_score"])
    print(hits["_source"][phone]["mobile"])
    print(hits["_source"][phone]["home"])

```

but I seem to be having an issue getting the data from

- mobile
- home.

Any recommendations? I am using python

---

<div class="post-metadata">

**Author:** ![iukea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iukea/32/49083_2.png) [@iukea](https://discuss.elastic.co/u/iukea)\
**Post date:** [May 7, 2019, 3:51am UTC](https://discuss.elastic.co/t/scroll-api-and-some-parsing-issues-python/179864/2 "2019-05-07T03:51:59Z")

</div>

This has also been posted here.

[https://stackoverflow.com/questions/56014461/scroll-api-and-some-parsing-issues-python](https://stackoverflow.com/questions/56014461/scroll-api-and-some-parsing-issues-python)

---

<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:** [June 4, 2019, 3:52am UTC](https://discuss.elastic.co/t/scroll-api-and-some-parsing-issues-python/179864/3 "2019-06-04T03:52:05Z")

</div>

Closed on June 4, 2019, 3:52am UTC

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