# Migration from transport to rest

**URL:** <https://discuss.elastic.co/t/migration-from-transport-to-rest/127298>\
**Category:** Elasticsearch\
**Created:** [April 9, 2018, 10:01am UTC](https://discuss.elastic.co/t/migration-from-transport-to-rest/127298 "2018-04-09T10:01:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ts\_rana](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@ts\_rana](https://discuss.elastic.co/u/ts_rana)\
**Post date:** [April 9, 2018, 10:01am UTC](https://discuss.elastic.co/t/migration-from-transport-to-rest/127298/1 "2018-04-09T10:01:50Z")

</div>

Could anyone help me to find corresponding rest API for this (prepare index with indexWriteAlias)???

protected void indexDoc(String indexWriteAlias) {  
client.prepareIndex(indexWriteAlias, "rollover")  
.setSource("{"foo": "bar"}", XContentType.JSON)  
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)  
.execute().actionGet();

}

---

<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:** [May 7, 2018, 10:02am UTC](https://discuss.elastic.co/t/migration-from-transport-to-rest/127298/2 "2018-05-07T10:02:02Z")

</div>

Closed on May 7, 2018, 10:02am UTC

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