【发布时间】:2014-08-26 23:18:23
【问题描述】:
我想为我的在线购物网站实现一个搜索引擎
我测试了一些分析器,但我没有看到它们之间的显着差异。我使用了雪球、ngram、标准分析器
我不知道哪个分析仪适合产品名称并给我最好的结果,我也不知道我应该使用哪个搜索查询
这是我的映射架构
{
"settings": {
"analysis": {
"analyzer": {
"autocomplete": {
"type": "custom",
"tokenizer": "standard",
"filter": ["standard", "lowercase", "stop", "kstem", "ngram"]
}
}
}
}
,
"mappings": {
"products": {
"properties": {
"id": {
"type": "integer",
"index": "no"
},
"name": {
"type": "multi_field",
"fields": {
"name": {
"type": "string"
},
"snowball": {
"type": "string",
"analyzer": "snowball"
},
"autocomplete": {
"analyzer": "autocomplete",
"type": "string"
}
}
}
}
}
}
和搜索查询,我不知道使用匹配查询是否适合我的用例
{
"query": {
"multi_match": {
"fuzziness":2,
"type" : "phrase",
"query": "term",
"fields": ["name", "name.snowball",
"name.autocomplete"]
}
}
}
【问题讨论】:
标签: search elasticsearch search-engine