# Elasticsearch python client expand\_action\_callback function question

**URL:** <https://discuss.elastic.co/t/elasticsearch-python-client-expand-action-callback-function-question/258372>\
**Category:** Elasticsearch\
**Created:** [December 11, 2020, 6:04am UTC](https://discuss.elastic.co/t/elasticsearch-python-client-expand-action-callback-function-question/258372 "2020-12-11T06:04:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Safak\_Kaya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/safak_kaya/32/80654_2.png) [@Safak\_Kaya](https://discuss.elastic.co/u/Safak_Kaya)\
**Post date:** [December 11, 2020, 6:04am UTC](https://discuss.elastic.co/t/elasticsearch-python-client-expand-action-callback-function-question/258372/1 "2020-12-11T06:04:43Z")

</div>

Hi all,

I'm trying to use expand\_action\_callback function to get back one of the action fields from the streaming\_bulk response. There is "\_id" but I need to access another field which is in the original action.

Am I on the right track? Can expand\_action\_callback be used for this purpose?

Currently I am using a monkey-patch on "streaming\_bluk" function that adds raw data in to the response as a messy work-around.

Accessing my field in the posted actions data as in below example:

```auto
for ok, item, raw_data in streaming_bulk_patch(es, actions):
    print(raw_data['raw_data']['nosql_id'])

```

---

<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:** [January 8, 2021, 6:05am UTC](https://discuss.elastic.co/t/elasticsearch-python-client-expand-action-callback-function-question/258372/2 "2021-01-08T06:05:02Z")

</div>

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