I am using IndexRequest from elastic 6.3.2. Now I changed to version 7.6.2. How can I do the same below steps using the CreateIndexRequest?
Elastic rest high level client 6.3.2 code:
public Object createIndex(Object document, String id) throws IOException {
Map documentMapper = objectMapper.convertValue(document, Map.class);
IndexRequest indexRequest = new IndexRequest(this.getIndexName(),
type, id).source(documentMapper, XContentType.JSON);
IndexResponse indexResponse = client.index(indexRequest);
return null;
}
After switching to 7.6.2 I am not able to create type, id and source in CreateIndexRequest.