标签:ping 文档 network har -o local fulltext npm releases
server { listen 80; server_name server_ip; location / { proxy_pass http://localhost:5601; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection ‘upgrade‘; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }
注意修改配置文件,server_name ip
启动Nginx服务
systemctl start nginx
systemctl enable nginx
验证http://localhost
创建一个index curl -u elastic:changeme -XPUT http://localhost:9200/index 创建一个mapping curl -u elastic:changeme -XPOST http://localhost:9200/index/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 } } } }‘ 创建index curl -u elastic:changeme -XPOST http://localhost:9200/index/fulltext/1 -d‘ {"content":"世界如此之大"} ‘ curl -u elastic:changeme -XPOST http://localhost:9200/index/fulltext/2 -d‘ {"content":"世界如此美好"} ‘ 查询 curl -u elastic:changeme -XPOST http://localhost:9200/index/fulltext/_search -d‘ { "query" : { "match" : { "content" : "世界" }}, "highlight" : { "pre_tags" : ["<tag1>", "<tag2>"], "post_tags" : ["</tag1>", "</tag2>"], "fields" : { "content" : {} } } } ‘
标签:ping 文档 network har -o local fulltext npm releases
原文地址:http://www.cnblogs.com/Mrhuangrui/p/6994102.html