Es 利用id、OpType实现插入时候检查是否存在

elasticsearchTemplate.getClient().prepareIndex(indexName, type).setId(id).setSource(json).setOpType(IndexRequest.OpType.CREATE).execute().actionGet();

posted on 2018-04-26 21:41  yangjingzhi  阅读(934)  评论(0编辑  收藏  举报

导航