es 实战练习

准备工作,启动es , 打开postman--》body- row-json

增加数据 注意put 方法

PUT /megacorp/employee/1
{
    "first_name" : "John",
    "last_name" :  "Smith",
    "age" :        25,
    "about" :      "I love to go rock climbing",
    "interests": [ "sports", "music" ]
}


PUT /megacorp/employee/2
{
    "first_name" :  "Jane",
    "last_name" :   "Smith",
    "age" :         32,
    "about" :       "I like to collect rock albums",
    "interests":  [ "music" ]
}

PUT /megacorp/employee/3
{
    "first_name" :  "Douglas",
    "last_name" :   "Fir",
    "age" :         35,
    "about":        "I like to build cabinets",
    "interests":  [ "forestry" ]
}

查询数据 注意是get方法

http://localhost:9200/megacorp/employee/1

 

上一篇:第17篇-使用Python的初学者Elasticsearch教程


下一篇:C#多文件打包下载