我在Elasticsearch中有一个查询,我希望在多个字段上匹配以获得常量分数
"query": {
"bool": {
"must": [
{
"constant_score": {
"multi_match": {
"query": "e w h",
"fields": [
"displayterm.ngram",
"citalias1.ngram",
"citalias2.ngram"
],
"type": "phrase_prefix"
}
}
}
],
但是我收到以下错误:
" [constant_score]查询不支持[multi_match]",
答案 0 :(得分:-2)
您需要将multi_match
查询包装在query
对象中:
{
"query": {
"bool": {
"must": [
{
"constant_score": {
"query": {
"multi_match": {
"query": "e w h",
"fields": [
"displayterm.ngram",
"citalias1.ngram",
"citalias2.ngram"
],
"type": "phrase_prefix"
}
}
}
}
]
}
}
}