1.新建索引
localhost:9200/docutone_dtnvdr
{
"mappings": {
"properties": {
"operatingTime": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
},
"operTime": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
},
"operatortype": {
"type": "text",
"fielddata": true
}
}
}
}
2.导入数据
3.设置检索字段fielddata
localhost:9200/docutone_dtnvdr/_mapping
{
"properties": {
"crateBy": {
"type": "text",
"fielddata": true
},
"operType": {
"type": "text",
"fielddata": true
}, "profileId": {
"type": "text",
"fielddata": true
},"groupId": {
"type": "text",
"fielddata": true
},"operatortype": {
"type": "text",
"fielddata": true
}
}
}
//创建索引使用ik分词
{
"mappings": {
"properties": {
"docName": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart"
},
"content": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart"
}
}
}
}