# Does Rally support benchmarking partial updates (doc\_as\_upsert)

**URL:** <https://discuss.elastic.co/t/does-rally-support-benchmarking-partial-updates-doc-as-upsert/101081>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [September 19, 2017, 11:59pm UTC](https://discuss.elastic.co/t/does-rally-support-benchmarking-partial-updates-doc-as-upsert/101081 "2017-09-19T23:59:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [September 20, 2017, 10:44am UTC](https://discuss.elastic.co/t/does-rally-support-benchmarking-partial-updates-doc-as-upsert/101081/2 "2017-09-20T10:44:01Z")

</div>

Hi @Zixuan_Liu,

Rally does not support the update API out of the box. However, you can write a so-called [custom runner](http://esrally.readthedocs.io/en/stable/adding_tracks.html#custom-runners) and use the Python client's [`update()`](http://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.Elasticsearch.update) method.

However, that solves only part of the problem. You also need a way to specify the documents that you want to update. This is what so-called [parameter sources](http://esrally.readthedocs.io/en/stable/adding_tracks.html#custom-parameter-sources) are meant for. It depends a bit how you provide the documents to upsert.

- The simplest case would be to use just a `dict` or to generate the documents on the fly. Then you can write a parameter source similar to the one in the documentation.
- Alternatively you could also read them from a file. However, this is more complicated, especially if you want to use this with multiple clients. For bulk-indexing Rally provides a pretty generic solution that allows you to read portions a file with an arbitrary number of clients but it is by far the [most complex parameter source](https://github.com/elastic/rally/blob/master/esrally/track/params.py#L170-L235). In your special case, however, you might get away with a less generic solution: You could create one file per client. If you want to go down that route I think our [bulk parameter source](https://github.com/elastic/rally/blob/master/esrally/track/params.py#L170-L235) could still serve as a starting point.

I hope that helps you to get started.

Daniel

---

_[View the full topic](https://discuss.elastic.co/t/does-rally-support-benchmarking-partial-updates-doc-as-upsert/101081)._
