老师您好,有个问题请教下,感谢:
文本值"新建文件夹",采用ik_smart分词器后,会被分成 新建、文件夹 两个单词,,用户输入"新建文”单词搜索不到,采用的match查询也无效,索引结构及查询语句如下:
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 2
},
"mappings": {
"_doc": {
"properties": {
"id": {
"type": "keyword"
},
"documentId": {
"type": "integer"
},
"name": {
"type": "text",
"analyzer": "ik_smart"
},
"content": {
"type": "text",
"analyzer": "ik_smart"
},
"labelName": {
"type": "text"
},
"ownerName": {
"type": "text"
},
"lastBrowseUser": {
"type": "text"
},
"createTime": {
"type": "date"
},
"updateTime": {
"type": "date"
},
"lastBrowseTime": {
"type": "date"
},
"type": {
"type": "keyword"
}
}
}
}
}
{
"bool": {
"must": [
{
"multi_match": {
"query": "新建文",
"fields": [
"name^1.0"
],
"type": "best_fields",
"operator": "OR",
"slop": 0,
"prefix_length": 0,
"max_expansions": 50,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"fuzzy_transpositions": true,
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}