PUT /student PUT /student/_doc/1 { "name" : "张三", "class" : "101", "age" : 10, "about" : "I like to collect rock albums", "tags": [ "乒乓球","羽毛球" ] } PUT /student/_doc/2 { "name" : "李四", "class" : "101", "age" : 12, "about" : "我是李四", "tags": [ "篮球","羽毛球" ] } PUT /student/_doc/3 { "name" : "王五", "class" : "102", "age" : 13, "about" : "俺是王五", "tags": [ "足球","篮球" ] } PUT /student/_doc/4 { "name" : "孙六", "class" : "101", "age" : 14, "about" : "俺是孙六", "tags": [ "乒乓","篮球" ] } get /student/_doc/1 GET /student/_search GET /student/_search { "query" : { "match" : { "class" : "101" } } } GET /student/_search { "query" : { "bool": { "must": { "match" : { "class" : "101" } }, "filter": { "range" : { "age" : { "gt" : 11 } } } } } } GET /student/_search { "query" : { "match" : { "about" : "俺是" } } } GET /student/_search { "query" : { "match_phrase" : { "about" : "俺是" } }, "highlight": { "fields" : { "about" : {} } } }
标签:search,GET,练习,about,student,101,class,es From: https://www.cnblogs.com/wenwenzuiniucha/p/17011015.html