ReindexRequest request = new ReindexRequest();
request.setSourceIndices("mytest");
request.setDestIndex("mytest");
request.setScroll(TimeValue.timeValueMinutes(5));
request.setRemoteInfo(
new RemoteInfo(
"http", "127.0.0.1", 9200,null,
new BytesArray(new
MatchAllQueryBuilder().toString()),
null, null, Collections.emptyMap(),
new TimeValue(100, TimeUnit.MILLISECONDS),
new TimeValue(100, TimeUnit.SECONDS)
)
);
It doesn't like Collections.emptyMap(), gives an error :
incompatible types:
java.util.Map<java.lang.Object,java.lang.Object> cannot be
converted to java.util.Map<java.lang.String,java.lang.String>
Here is a simple program that works
import java.io.IOException;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.reindex.ReindexRequest;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.RemoteInfo;
import org.elasticsearch.index.query.MatchAllQueryBuilder;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.bytes.BytesArray;
import org.apache.http.HttpHost;
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.