标签:mit log first sea url last als for john
curl -XPUT http://localhost:9200/suoyin1 curl -XPOST http://localhost:9200/suoyin1/fulltext/_mapping -d‘ { "fulltext": { "_all": { "analyzer": "ik_max_word", "search_analyzer": "ik_max_word", "term_vector": "no", "store": "false" }, "properties": { "content": { "type": "text", "analyzer": "ik_max_word", "search_analyzer": "ik_max_word", "include_in_all": "true", "boost": 8 } } } }‘ curl -XPOST http://localhost:9200/suoyin1/fulltext/1 -d‘ { "first_name" : "John1", "last_name" : "Smith1", "age" : 251, "about" : "I love to go rock climbing1", "interests": [ "sports", "music1" ] }‘ curl -XPOST http://localhost:9200/suoyin1/fulltext/2 -d‘ { "first_name" : "Jane1", "last_name" : "Smith1", "age" : 321, "about" : "I like to collect rock albums1", "interests": [ "music1" ] }‘ curl -XPOST http://localhost:9200/suoyin1/fulltext/3 -d‘ { "first_name" : "Douglas1", "last_name" : "Fir1", "age" : 351, "about": "I like to build cabinets1", "interests": [ "forestry1" ] }‘ curl -XPOST http://localhost:9200/suoyin/fulltext/_search -d‘ { "query": { "match": { "last_name": "smith" } } }‘ dsl 语句查询 http://localhost:9200/suoyin/fulltext/ { "query" : { "match" : { "last_name" : "Smith" } } }
suoyin1:索引名称,相当于数据库
fulltext:文档的类型
1,2,3:员工的ID
标签:mit log first sea url last als for john
原文地址:http://www.cnblogs.com/wangchuanfu/p/7298478.html