manticoresearch
manticoresearch copied to clipboard
The html_strip_mode option in highlight with http request returns an Unknown option: strip_mode error
I have an index with html_strip
set to 1, when I set html_strip_mode
to retain
or none
in http request, manticore response with an error:
{
"error": "index regulations: parse error: Unknown option: strip_mode"
}
The option index
works fine.
reproduce:
-
create table t(f text) html_strip='1';insert into t(f) values('<p>你好 manticore 哈哈哈哈 </p>')
- the worked case:
- request
{
"index": "t",
"query": {
"query_string": "你好"
},
"highlight": {
"limit": 0,
"html_strip_mode": "index"
}
}
- response:
{
"took": 0,
"timed_out": false,
"hits": {
"total": 1,
"total_relation": "eq",
"hits": [
{
"_id": "3460511486852464642",
"_score": 1,
"_source": {
"f": "<p>你好 manticore 哈哈哈哈 </p>"
},
"highlight": {
"f": [
" 你好 manticore 哈哈哈哈 "
]
}
}
]
}
}
- the error case:
- request:
{
"index": "t",
"query": {
"query_string": "你好"
},
"highlight": {
"limit": 0,
"html_strip_mode": "none"
}
}
- response:
{
"error": "index t: parse error: Unknown option: strip_mode"
}
Another MRE showing the same error with option encoder
:
➜ ~ mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) html_strip='1'; insert into t(f) values('<p>abc</p>');"
➜ ~ curl -sX POST http://localhost:9308/search -d '
{
"index": "t",
"query_string": "abc",
"highlight":
{
"fields": [ "f" ],
"encoder": "html"
}
}' |jq .
{
"error": "index t: parse error: Unknown option: strip_mode"
}
Noticed this behavior as well with the python client. Additionally, in certain documents, encoder set to default, does not result in any highlights. This may be related to special character issue mentioned in #863