How to make ElasticSearch add new documents, if the documents exist, not overwrite

Use the opType method to set the new mode, as follows:
Insert picture description here
Usage example:

request.opType(DocWriteRequest.OpType.CREATE);

Guess you like

Origin blog.csdn.net/weixin_38106322/article/details/112069987