模板代码
#item索引库
PUT /item
{
"settings": {
"analysis": {
"analyzer": {
"text_anlyzer": {
"tokenizer": "ik_max_word",
"filter": "py"
},
"completion_analyzer": {
"tokenizer": "keyword",
"filter": "py"
}
},
"filter": {
"py": {
"type": "pinyin",
"keep_full_pinyin": false,
"keep_joined_full_pinyin": true,
"keep_original": true,
"limit_first_letter_length": 16,
"remove_duplicated_term": true,
"none_chinese_pinyin_tokenize": false
}
}
}
},
"mappings": {
"properties": {
"id":{
"type": "keyword"
},
"name":{
"type": "text",
"analyzer": "text_anlyzer",
"search_analyzer": "ik_smart",
"copy_to": "all"
},
"price":{
"type": "double"
},
"stock":{
"type": "long"
},
"image":{
"type": "keyword",
"index": false
},
"category":{
"type": "keyword"
},
"brand":{
"type": "text",
"analyzer": "ik_max_word",
"copy_to": "all"
},
"spec":{
"type": "text",
"analyzer": "ik_max_word"
},
"sold":{
"type": "long"
},
"commentCount":{
"type": "long"
},
"status":{
"type": "integer",
"index": false
},
"jsAD":{
"type": "boolean",
"index": false
},
"createTime":{
"type": "date",
"index": false
},
"updateTime":{
"type": "date",
"index": false
},
"all":{
"type": "text",
"analyzer": "text_anlyzer",
"search_analyzer": "ik_smart"
},
"suggestion":{
"type": "completion",
"analyzer": "completion_analyzer"
}
}
}
}