index/type/id index = 关系型数据库database type = 关系型数据库table id = 关系型数据库主键id 必须唯一 不指定则自动生成
PUT /megacorp/employee/1
{
"first_name" : "John",
"last_name" : "Smith",
"age" : 25,
"about" : "I love to go rock climbing",
"interests": [ "sports", "music" ]
}
检索索引
GET /megacorp/employee/1
{
"_index" : "megacorp", //索引
"_type" : "employee", //索引type
"_id" : "1", //索引id
"_version" : 1, //修改次数
"found" : true, //是否找到
"_source" : { //内容
"first_name" : "John",
"last_name" : "Smith",
"age" : 25,
"about" : "I love to go rock climbing",
"interests": [ "sports", "music" ]
}
}