您的位置:首页 > 其它

ElasticSearch 新增表字段

2018-03-16 10:41 141 查看
1.新增表字段(Elasticsearch中的mapping一旦创建,就不能再修改。但是添加字段是可以的)::PUT my_index/_mapping/my_type
{
  "properties": {
    "new_column": {
      "type":     "integer"
    }
  }
}2.修改表字段的方法 http://www.cnblogs.com/Creator/p/3722408.html
3.ElasticSearch 数据架构的主要概念(与关系数据库Mysql对比)



4.多字段查询:POST /my_index/post/_search
{

"query": {
"bool": {
"must": {
"multi_match" : {
"query" : "search_key",
"type" : "best_fields",
"fields" : ["column1", "column2"],
"analyzer" : "ik_smart"
}
},
"filter": {
"range":{
"column3":{
"lte":1//小于
}
}

}
}
},
"stored_fields": ["column1", "column2", "column3", "column4","column5"],
"highlight" : {//高亮显示
"fields" : {
"column1" : {},
"column2" : {}
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ElasticSearch