弹性搜索错误 - [prefix] query does not support [prefix]

Elastic search error - [prefix] query does not support [prefix]

当我post下面的查询时,我得到了一个错误响应

{"error":{"root_cause":[{"type":"parsing_exception","reason":"[prefix] query does not support [prefix]","line":1,"col":119}],"type":"parsing_exception","reason":"[prefix] query does not support [prefix]","line":1,"col":119},"status":400}

这是我的 POST 查询:

{"from":0,"size":10,"sort":{"_score":"desc"},"query":{"bool":{"must":{"bool":{"should":[[{"prefix":{"title":{"prefix":"of","boost":"1.0"}}}],{"multi_match":{"query":"of","fields":["title^1.0"]}},{"query_string":{"query":"(\"of\")","fields":["title^1.0"]}}]}}}}}

如何使此查询适用于我的自动完成搜索?

前缀命令接受 "value" 而不是 "prefix"。另外 "boost" 值是数字类型,所以它不应该用引号引起来。

所以应该是:

{"prefix":{"title":{"value":"of","boost":1.0}}}

而不是:

{"prefix":{"title":{"prefix":"of","boost":"1.0"}}}