【发布时间】:2016-02-07 10:23:06
【问题描述】:
我想通过匹配短语来提升查询,但我希望它只在某个字段中进行搜索。到目前为止,我有以下查询
{
"query": {
"bool": {
"should": [
{
"match_phrase": {
"_all": {
"query": "string",
"boost": 5
}
}
}
]
}
}
}
但这会返回几个结果,因为我没有指定它应该搜索的字段。我尝试了另一种方法:
{
"query": {
"bool": {
"should": [
{
"match_phrase": {
"_all": {
"query": "string",
"fields": [
"filed_name"
],
"boost": 5
}
}
}
]
}
}
}
但我得到了错误
[匹配]查询不支持[字段]]
【问题讨论】:
标签: elasticsearch match-phrase