elastic 添加一个索引

PUT /scddbmain
{
"mappings": {
"properties": {
"id": {
"type": "long"
},
"title": {
"type": "text",
"analyzer": "ik-index",
"search_analyzer": "ik-smart"
},
"content": {
"type": "text",
"analyzer": "ik-index",
"search_analyzer": "ik-smart"
},
"titlepic": {
"type": "text"
},
"is_show": {
"type": "long"
},
"weight": {
"type": "long"
},
"newstime": {
"type": "long"
},
"onclick": {
"type": "long"
},
"totaldown": {
"type": "long"
},
"sexi_type": {
"type": "long"
},
"banshi": {
"type": "long"
},
"fava": {
"type": "long"
},
"geshi": {
"type": "text"
},
"moshi": {
"type": "text"
}
}
}, 
"settings": {
"analysis": {
"filter": {
"local_synonym" : {
"type" : "synonym",
"synonyms_path" : "/etc/elasticsearch/analysis-ik/synonym.txt" //近义词词库
}
},
"analyzer": {
"ik-index": {
"type": "custom",
"tokenizer": "ik_max_word",
"filter": [
"local_synonym" 
]
},
"ik-smart": {
"type": "custom",
"tokenizer": "ik_smart",
"filter": [
"local_synonym"
]
}
}
}
}

}

  

  

posted @ 2019-10-30 21:28  likecs  阅读(406)  评论(0编辑  收藏  举报