I am getting a warning:
"[types removal] Specifying types in bulk requests is deprecated."]
What do I do wrong? This is my code:
BulkRequest request = new BulkRequest();
for(Item item : items) {
IndexRequest indexRequest = new IndexRequest(INDEX_NAME, DOC_TYPE, item.getIdentifier());
indexRequest
.opType(DocWriteRequest.OpType.INDEX) // Index the source. If there an existing document with the id, it will be replaced.
.source(JsonUtility.toJson(item), XContentType.JSON);
request.add(indexRequest);
}
elastic.bulk(request, RequestOptions.DEFAULT);
The mapping type
was removed in Elasticsearch 8 and is deprecated in Elasticsearch 7.
No Elasticsearch
version is mentioned in your question, but you can read more about the schedule for removal of mapping types, and react accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With