ElasticSearch Head插件常用操作命令

来源:互联网 发布:rimworld for mac 编辑:程序博客网 时间:2024/06/12 19:35

ElasticSearch Head插件   常用命令语句


表格中的1、2、3、4分别对应下图的四个输入框




用途1234查看mappinghttp://127.0.0.1:9200/test_v4/_mappingget查询数据http://127.0.0.1:9201/test_v4/type_v4/_searchget/post新增映射http://127.0.0.1:9202/test_v4/_mapping/type_v4PUT{
  "properties" : {
    "f_4" : {
      "type" :    "string",
      "store":    true,
      "term_vector":"with_positions_offsets_payloads",
"analyzer":"ik"

    }
  }
}query查询http://127.0.0.1:9203/test_v4/_searchpost{
 "query":{
  "term":{
   "f_3":"足球"
  }
 }
}插入数据http://127.0.0.1:9204/test_v4/type_v4/201702107put{"f_3":"这是测试"}query查询实例2http://127.0.0.1:9202/{
 "query":{
  "bool":{
   "should":[
    {"term":{"f_3":"足球"}},
    {"term":{"f_3":"比赛"}}
   ],
   "must_not":{
    "term":{"f_3":"裁判"}
   }
  }
 }
}查看explainhttp://127.0.0.1:9200/test_v4/_search?q=%E8%B6%B3%E7%90%83&pretty&explain直接在浏览器输入filter查询http://127.0.0.1:9200/test_v4/_searchpost{
 "filter":{
  "bool":{
   "should":[
    {"term":{"f_3":"足球"}},
    {"term":{"f_3":"比赛"}}
   ],
   "must_not":{
    "term":{"f_3":"裁判"}
   }
  }
 }
}测试分词结果http://127.0.0.1:9200/_analyze?analyzer=ik&pretty=true&text=这是一个关于中文分词的测试直接在浏览器输入




1 0
原创粉丝点击