1,创建Index:
需要使用全文索引的字段,需要添加analyzer属性
PUT /industry_index
{
"settings": {
"refresh_interval": "5s",
"number_of_shards" : 3,
"number_of_replicas" : 2,
"analysis" : {
"analyzer" : {
"ik" : {
"tokenizer" : "ik_max_word"
}
}
}},
"mappings": {
"industryCapacity": {
"properties": {
"degist": {
"type": "keyword"
},
"source": {
"type": "keyword"
},
"status": {
"type": "long"
},
"uploadTime": {
"type": "keyword"
},
"title": {
"type":"text",
"analyzer": "ik_max_word"
}
}
}
}
}