# Script based Bulk Update is not parsing the entire document into \_source

**URL:** <https://discuss.elastic.co/t/script-based-bulk-update-is-not-parsing-the-entire-document-into-source/327800>\
**Category:** Elasticsearch\
**Created:** [March 16, 2023, 4:52am UTC](https://discuss.elastic.co/t/script-based-bulk-update-is-not-parsing-the-entire-document-into-source/327800 "2023-03-16T04:52:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnushaTalluri](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@AnushaTalluri](https://discuss.elastic.co/u/AnushaTalluri)\
**Post date:** [March 16, 2023, 4:52am UTC](https://discuss.elastic.co/t/script-based-bulk-update-is-not-parsing-the-entire-document-into-source/327800/1 "2023-03-16T04:52:00Z")

</div>

We have an elasticsearch index created in 6.8.23 version, and we used to use script based updates for the documents, which used to be working fine as expected. After upgrading the Elasticsearch version to 7.17, the script based bulk update has stopped working.

Upon further analyzing the data, what we could see is, our 6.8.23 indices have created with custom type mapping, where as in 7.17 as type is deprecated we are not specifying any type while invoking the Bulk API. While executing the script, the **\_source** field is not having the entire document that we are sending.

My question here is, is this a supported scenario? Do we support script based updates for the 6.8.23 indices from 7.17 ES? If yes, could you please help in figuring out the steps that I'm missing here.

We have something like,

===============

```auto
BulkDescriptor bulkDescriptor = new BulkDescriptor();
bulkDescriptor.Update<T>(new BulkUpdateDescriptor<T,T>()
                          .Script(x=>x.Source("scriptName").Params(....))
                          .Id(...)
                          .Upsert(doc);

client.Bulk(bulkDescriptor).Index("indexName");

```

=================

I've tried by passing the .doc parameter to the descriptor, but that is not hitting the script. And I also have tried by providing typeasquery parameter, which is neither working to retrieve the \_source completely.

---

<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:** [April 13, 2023, 4:52am UTC](https://discuss.elastic.co/t/script-based-bulk-update-is-not-parsing-the-entire-document-into-source/327800/2 "2023-04-13T04:52:01Z")

</div>

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