Elasticsearch中文分词器问题
标签(空格分隔): Elasticsearch
使用ik_max_word搜索
用ik_smart分词
{
"mappings":{
"_doc":{
"properties":{
"name":{
"type":"text",
"analyzer":"ik_max_word",
"search_analyzer":"ik_smart"
}
}
}
}
}
{
"properties": {
"content": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart"
}
}
}
es 1.6版本
es 1.6版本的 elasticsearch-analysis-ik
postman设置
qx_lpd3的索引是不存在的
使用POST方法:
192.168.1.64:9200/qx_lpd3
配置信息
将index索引设置为:"not_analyzed"
{
"mappings" : {
"qx_lpd3" : {
"properties" : {
"province" : {
"type" : "string",
"index" : "not_analyzed"
},
"city" : {
"type" : "string",
"index" : "not_analyzed"
},
"county" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
}
}
``
_source
{
"mappings": {
"qx_lpd1": {
"_source": {
"enabled": false
},
"properties": {
"province": {
"type": "string",
"index":"not_analyzed"
},
"strength": {
"type": "double"
},
"city": {
"type": "string",
"index":"not_analyzed"
},
"gradient": {
"type": "double"
},
"latitude": {
"type": "double"
},
"county": {
"type": "string",
"index":"not_analyzed"
},
"locatemode": {
"type": "string"
},
"time": {
"type": "string"
},
"errors": {
"type": "double"
},
"longitude": {
"type": "double"
}
}
}
}
}