Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The html_strip_mode option in highlight with http request returns an Unknown option: strip_mode error #857

Open
washanhanzi opened this issue Aug 18, 2022 · 2 comments

Comments

@washanhanzi
Copy link

washanhanzi commented Aug 18, 2022

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:

  1. create table t(f text) html_strip='1';insert into t(f) values('<p>你好 manticore 哈哈哈哈 </p>')
  2. 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 哈哈哈哈 "  
					]  
				}  
			}  
		]  
	}  
}  
  1. 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"  
}  
@sanikolaev
Copy link
Collaborator

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"
}

@sanikolaev sanikolaev added the bug label Aug 18, 2022
@regstuff
Copy link

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

@githubmanticore githubmanticore changed the title The html_strip_mode option in highlight with http request returns an Unknown option: strip_mode error The html_strip_mode option in highlight with http request returns an Unknown option: strip_mode error Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants