There are exists old way of re-indexing using TransportClient
but as it will be deprecated in ES7 what is the new way of reindexing using RestHighLevelClient
?
BulkByScrollResponse response = ReindexAction.INSTANCE.newRequestBuilder(client)
.destination("target_index")
.filter(QueryBuilders.matchQuery("category", "xzy"))
.get();
according to the docs this will be available in the next minor release (https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.5/java-rest-high-document-reindex.html)
maybe you should issue a http reindex request to the cluster: https://www.elastic.co/guide/en/elasticsearch/reference/6.4/docs-reindex.html