【发布时间】:2018-08-14 11:49:34
【问题描述】:
- 您对创建搜索请求有任何想法吗?多重匹配+部分词搜索。
{
"shop_index": {
"settings": {
"index": {
"number_of_shards": "5",
"provided_name": "shop_index",
"creation_date": "1534235625279",
"analysis": {
"filter": {
"nGram_filter": {
"token_chars": [
"letter",
"digit",
"punctuation",
"symbol"
],
"min_gram": "2",
"type": "nGram",
"max_gram": "20"
}
},
"analyzer": {
"nGram_analyzer": {
"filter": [
"lowercase",
"asciifolding",
"nGram_filter"
],
"type": "custom",
"tokenizer": "whitespace"
},
"whitespace_analyzer": {
"filter": [
"lowercase",
"asciifolding"
],
"type": "custom",
"tokenizer": "whitespace"
}
}
},
"number_of_replicas": "1",
"uuid": "SBB9u344RVGm1QQUo-rVMg",
"version": {
"created": "6030299"
}
}
}
}
}
- 映射
{
"shop_index": {
"mappings": {
"products": {
"properties": {
"html_keywords": {
"type": "text"
},
"html_title": {
"type": "text"
},
"name": {
"type": "text"
}
}
}
}
}
}
- 我想搜索短语,例如 -> 搜索“HOUSE”
- 打字 -> “ho” -> 显示“HOUSE”
- 打字->“侯”->给我看“房子”
- 打字->“使用”->给我看“房子”
- 打字 -> “se” -> 显示“HOUSE”
【问题讨论】:
标签: elasticsearch search search-engine elasticsearch-6