use of org.elasticsearch.index.reindex.remote.RemoteInfo in project elasticsearch by elastic.
the class ReindexRequestTests method testReindexFromRemoteDoesNotSupportSearchQuery.
public void testReindexFromRemoteDoesNotSupportSearchQuery() {
ReindexRequest reindex = newRequest();
reindex.setRemoteInfo(new RemoteInfo(randomAsciiOfLength(5), randomAsciiOfLength(5), between(1, Integer.MAX_VALUE), new BytesArray("real_query"), null, null, emptyMap(), RemoteInfo.DEFAULT_SOCKET_TIMEOUT, RemoteInfo.DEFAULT_CONNECT_TIMEOUT));
// Unsupported place to put query
reindex.getSearchRequest().source().query(matchAllQuery());
ActionRequestValidationException e = reindex.validate();
assertEquals("Validation Failed: 1: reindex from remote sources should use RemoteInfo's query instead of source's query;", e.getMessage());
}
Aggregations