[Reindex in Java API] how to reindex subset of fields


(Charlie Wu) #1

In Rest API, there's a function to reindex only a subset of the fields from the original documents by using source
POST _reindex
{
"source": {
"index": "twitter",
"_source": ["user", "_doc"]
},
"dest": {
"index": "new_twitter"
}
}

How can I do this by Java API?
references:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-reindex.html