# Defining IDs and routing keys for documents in custom workloads in Rally

**URL:** <https://discuss.elastic.co/t/defining-ids-and-routing-keys-for-documents-in-custom-workloads-in-rally/184186>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [June 4, 2019, 1:07pm UTC](https://discuss.elastic.co/t/defining-ids-and-routing-keys-for-documents-in-custom-workloads-in-rally/184186 "2019-06-04T13:07:28Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![luisrpp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luisrpp/32/7625_2.png) [@luisrpp](https://discuss.elastic.co/u/luisrpp)\
**Post date:** [June 5, 2019, 1:45pm UTC](https://discuss.elastic.co/t/defining-ids-and-routing-keys-for-documents-in-custom-workloads-in-rally/184186/3 "2019-06-05T13:45:49Z")

</div>

I was trying to load a file like this:

```
{ “index” : { “_index” : “test”, “_type” : “type1”, “_id” : “1”, “_routing : 2 } }
{“firstname”:“first_name1”,“lastname”:“last_name1”,“client”:100,“customerID”:2}
{ “index” : { “_index” : “test”, “_type” : “type1”, “_id” : “2”, “_routing : 2 } }
{“firstname”:“first_name2”,“lastname”:“last_name2”,“client”:100,“customerID”:2}
{ “index” : { “_index” : “test”, “_type” : “type1”, “_id” : “3”, “_routing : 2 } }
{“firstname”:“first_name3”,“lastname”:“last_name3”,“client”:200,“customerID”:2}

```

Based on this post ([How to index routing id based document in rally](https://discuss.elastic.co/t/how-to-index-routing-id-based-document-in-rally/95321/2)), I was trying to use the same approach, with `"operation-type": "index"`. Got a message that this is an invalid operation.

Just realized that there is a property for documents called `includes-action-and-meta-data`. That solved the problem.

Sorry I didn't check that before.

Regards,  
Luis

---

_[View the full topic](https://discuss.elastic.co/t/defining-ids-and-routing-keys-for-documents-in-custom-workloads-in-rally/184186)._
