elasticsearch使用multi_match, type为phrase查询nested类型字段时报错

这是索引信息
image.png

这是查询语句, spring data es生成的

{
    "query": {
        "bool": {
            "must": [
                {
                    "nested": {
                        "query": {
                            "multi_match": {
                                "query": "星火通讯",
                                "fields": [
                                    "nameValues.entityName^1.0",
                                    "nameValues.firstName^1.0",
                                    "nameValues.originalScriptNames^1.0",
                                    "nameValues.singleStringNames^1.0",
                                    "nameValues.surname^1.0"
                                ],
                                "type": "phrase",
                                "operator": "OR",
                                "slop": 0,
                                "prefix_length": 0,
                                "max_expansions": 50,
                                "zero_terms_query": "NONE",
                                "auto_generate_synonyms_phrase_query": true,
                                "fuzzy_transpositions": true,
                                "boost": 1
                            }
                        },
                        "path": "nameValues",
                        "ignore_unmapped": false,
                        "score_mode": "sum",
                        "boost": 1
                    }
                }
            ],
            "filter": [
                {
                    "term": {
                        "whiteList": {
                            "value": -1,
                            "boost": 1
                        }
                    }
                },
                {
                    "term": {
                        "watchTypeCode": {
                            "value": 0,
                            "boost": 1
                        }
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1
        }
    }
}

然后就是报错了
image.png

但是不设置类型为phrase时就没有问题, 是phrase类型不支持嵌套查询还是什么呢

阅读 1.5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题