ElasticSearch设置自定义_id

在请求的URL上附加上想要设置的_id的值

POST /yaeher-article/_doc/sergivandebunorwichpublishid
{
	"author":"Sergi·Van·Debunorwich",
	"authorFullName":"谢尔盖·范·德彪诺维奇",
	"authorOpenId":"wodeopenid",
	"category":"一级",
	"content":"内容",
	"publishId":"sergivandebunorwichpublishid",
	"source":"刘老根大舞台",
	"status":0,
	"tags":"模板",
	"title":"自我介绍介绍",
	"upvotes":5,
	"url":"www.baidu.com",
	"views":99
}

你可能感兴趣的:(ES,elasticsearch)