elasticsearch设置索引的mappings和settings
为了配置自定义的analyzer,辗转许久终于找到方法我个人是在虚拟机上安装的kibana服务里那个dev tools里操作的,如下PUT /africa_test/{"settings": {"analysis": {"filter": {"english_stop": {"type":"stop","stopwords":"_english_"},"hu
·
为了配置自定义的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"
},
"source": {"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"subject": {"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}
}
更多推荐
已为社区贡献2条内容
所有评论(0)