赞
踩
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" : {}
}
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。