`highlight_query.query_string` 仍然会丢弃引号包围的表达式 - #4115 的修复并未覆盖 JSON 路径

作者: Arturus创建于 2026年9月16日更新于 2026年9月16日
bash
ZZTERM4ZZ run --rm -d --name mant -p 19308:9308 manticoresearch/manticore:latest
bash
curl -s 'http://127.0.0.1:19308/sql?mode=raw' --data-urlencode "query=CREATE TABLE t (content text)"
curl -s 'http://127.0.0.1:19308/sql?mode=raw' --data-urlencode "query=INSERT INTO t (id, content) VALUES (1, 'a hello world example')"

1. The phrase as the main query — matches

bash
curl -s http://127.0.0.1:19308/search -H 'Content-Type: application/json' -d '
{"table":"t","query":{"query_string":"\"hello world\""},"limit":1,"_source":[""]}'
json
{"hits":{"total":1,"hits":[{"_id":1,"_score":2500,"_source":{}}]}}

2. The same phrase as highlight_query.query_string — empty block

bash
curl -s http://127.0.0.1:19308/search -H 'Content-Type: application/json' -d '
{"table":"t","query":{"query_string":"hello"},"limit":1,"_source":[""],
 "highlight":{"fields":["content"],"highlight_query":{"query_string":"\"hello world\""},"allow_empty":true}}'
json
{"hits":{"hits":[{"_id":1,"_source":{},"highlight":{}}]}}

3. The same words unquoted — highlighted

bash
... "highlight_query":{"query_string":"hello world"} ...
json

内容来源: manticoresoftware/manticoresearch