为了配置自定义的analyzer,辗转许久终于找到方法
我个人是在虚拟机上安装的kibana服务里那个dev tools里操作的,如下
PUT /africa_test/
{
"settings": {
"analysis": {
"filter": {
"english_stop": {
"type": "stop",
"stopwords": "_english_"
},
"hunspell_en_US": {
"type": "hunspell",
"language": "en_US"
}
},
"analyzer": {
"english": {
"tokenizer": "standard",
"filter": [
"lowercase",
"english_stop",
"hunspell_en_US",
"asciifolding"
]
}
}
}
},
"mappings": {
"properties": {
"myid":{"type":"keyword",
"index": true
},
"question": {"type": "text",
"index": true,
"analyzer": "english",
"search_analyzer": "english"
},
"accuratequestion": {"type": "text"
},
"questionfh1": {"type": "text",
"index": true,
"analyzer": "english",
"search_analyzer": "english"
},
"questionfh2": {"type": "text",
"index": true,
"analyzer": "english",
"search_analyzer": "english"
},
"answer": {"type": "text"
},
"subject": {"type": "text"}
}
}
}
|