elasticSearch

get   localhost:9200/_count?pretty    //返回总数

put   localhost:9200/megacorp/employee/3     //插入id为3的数据

{

"first_name" :  "Douglas",

"last_name" :  "Fir",

"age" :        35,

"about":        "I like to build cabinets",

"interests":  [ "forestry" ]

}

get localhost:9200/megacorp/employee/3   //查询id为3的数据

get localhost:9200/megacorp/employee/_search    //搜索,默认10条

get localhost:9200/megacorp/employee/_search?q=last_name:Smith   //搜索last_name字段为smith的数据

_search?q=key:value           eg:    _search?q=last_name:smith   (不区分大小写)

_search?q=value    ge:  _search?q=smith

get localhost:9200/megacorp/employee/_search  //构造查询条件

{

"query":{

"match":{

"last_name":"smith"

}}}

你可能感兴趣的:(elasticSearch)