es基本操作

(1)建立索引

  1) 创建索引

  

  2)创建索引(以及设置分片,设置分词,设置映射)

  

 (2)创建映射

  

{
    "properties":{
        "name":{
            "type":"text"    
        },
        "age":{
            "type":"text"
        },
        "ava":{
            "type":"text"
        }
    }
}

(3)查看映射  

  

http://47.105.90.93:9200/index1/_mapping/data_info

(4)创建文档

  

{
    "name":"songyan",
    "ava":"codding",
    "age":"15"
}

 (5)查看文档

  1)根据id查看

   

http://47.105.90.93:9200/index1/data_info/1

  2)搜索的方式查看

  根据关键词(查询name字段有song的)

   

原文地址:https://www.cnblogs.com/excellencesy/p/10538474.html