【发布时间】:2016-06-05 20:21:32
【问题描述】:
如何使用 Elasticsearch 查找短语中缺失的单词?例如,我想查找包含此模式make * great again 的所有文档,我尝试使用通配符查询但它没有返回任何结果:
{
"fields": [
"file_name",
"mime_type",
"id",
"sha1",
"added_at",
"content.title",
"content.keywords",
"content.author"
],
"highlight": {
"encoder": "html",
"fields": {
"content.content": {
"number_of_fragments": 5
}
},
"order": "score",
"tags_schema": "styled"
},
"query": {
"wildcard": {
"content.content": "make * great again"
}
}
}
如果我输入一个单词并使用 match_phrase 查询,我会得到结果,所以我知道我有与模式匹配的数据。
我应该使用哪种类型的查询?还是我需要在字段中添加某种类型的自定义分析器?
【问题讨论】:
标签: elasticsearch