Bug in official document sample

In the page https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-pattern-analyzer.html, there is a sample as below:


PUT /test
"settings": {
"analysis": {
"analyzer": {
"whitespace": {
"type": "pattern",
"pattern": "\s+"

GET /test/_analyze?analyzer=whitespace&text=foo,bar baz

"foo,bar", "baz"

But actually it outputs "foo", "bar", "baz", how to output "foo,bar", "baz"?
Any help is welcome.

Is that this one - https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-pattern-analyzer.html#_whitespace_tokenizer?

It seems that your post formatting may have lost some of the code, use the </> button to format things :slight_smile:

Thanks for your instant reply. Please see the url: https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-pattern-analyzer.html
, what I need is an analyzer which could output terms "foo,bar", "baz" for input "foo,bar;baz"? Could you help me ?

My data like this: "Jack,Ma;Mary Wu;", I just want it to be tokenized by semicolon, so it should bring out "Jack,Ma", "Mary Wu".