【发布时间】:2017-10-01 05:09:44
【问题描述】:
当前弹性映射:
"properties": {
"content": {
"type": "text",
"term_vector":"with_positions_offsets",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "russian"
}
}
字段“内容”包含网站爬取的结果,正是页面“正文”标签内容,从标签中剥离。 任务是实现对该字段的三种搜索。 1.所有指定的单词 2.任何指定的词 3.正好在正文中
对于 1 个案例 - match_phrase 对于 2 案例 - 匹配 对于 3 种情况 - 必须有 match_phrase 而不进行分析,因为使用“俄语”分析器会发现这个短语具有不同的结尾和变格
尝试了这个查询但没有运气:
"query": {
"bool": {
"must": [
{
"match_phrase": {
"content": {
"query": "some search phraze",
"analyzer": "keyword"
}
}
}
]
}
【问题讨论】:
标签: elasticsearch full-text-search