Hi,
I'm using the High Level Rest client from java. specific version is 6.6.1 against an ES v6.5.4
I'm getting the following error when I try to do a BulkRequest which are all IndexRequests
java.lang.NoSuchMethodError: org.elasticsearch.action.bulk.BulkRequest.pipeline()Ljava/lang/String;
Happy to file an issue, but was wondering if someone might know what's up in case it's a non issue.
Below is the code I'm using:
BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("elastic", "changeme"));
RestClientBuilder builder = RestClient.builder(new HttpHost("asus.local", 9200))
.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider));
RestHighLevelClient client = new RestHighLevelClient(builder);
BulkRequest request = new BulkRequest();
String line;
while ((line = reader.readLine()) != null) {
String[] split = line.split(",");
Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(split[0]);
Map< String, Object> jsonMap = new HashMap< String, Object>();
jsonMap.put("valuedate", date);
jsonMap.put("value", Double.valueOf(split[1]));
IndexRequest indexRequest = new IndexRequest("my_index", "doc", String.valueOf(row))
.source(jsonMap);
request.add(indexRequest);
}
System.out.println("starting bulk call");
BulkResponse bulkResponse = client.bulk(request, RequestOptions.DEFAULT);
System.out.println("DONE");