Skip to content

Commit

Permalink
[DOCS] Correct custom analyzer callouts (#46030)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodewig committed Aug 29, 2019
1 parent 6117c05 commit 271c864
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions docs/reference/analysis/analyzers/custom-analyzer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -162,26 +162,26 @@ PUT my_index
"settings": {
"analysis": {
"analyzer": {
"my_custom_analyzer": {
"my_custom_analyzer": { <1>
"type": "custom",
"char_filter": [
"emoticons" <1>
"emoticons"
],
"tokenizer": "punctuation", <1>
"tokenizer": "punctuation",
"filter": [
"lowercase",
"english_stop" <1>
"english_stop"
]
}
},
"tokenizer": {
"punctuation": { <1>
"punctuation": { <2>
"type": "pattern",
"pattern": "[ .,!?]"
}
},
"char_filter": {
"emoticons": { <1>
"emoticons": { <3>
"type": "mapping",
"mappings": [
":) => _happy_",
Expand All @@ -190,7 +190,7 @@ PUT my_index
}
},
"filter": {
"english_stop": { <1>
"english_stop": { <4>
"type": "stop",
"stopwords": "_english_"
}
Expand All @@ -207,9 +207,12 @@ POST my_index/_analyze
--------------------------------------------------
// CONSOLE

<1> The `emoticons` character filter, `punctuation` tokenizer and
`english_stop` token filter are custom implementations which are defined
in the same index settings.
<1> Assigns the index a default custom analyzer, `my_custom_analyzer`. This
analyzer uses a custom tokenizer, character filter, and token filter that
are defined later in the request.
<2> Defines the custom `punctuation` tokenizer.
<3> Defines the custom `emoticons` character filter.
<4> Defines the custom `english_stop` token filter.

/////////////////////
Expand Down

0 comments on commit 271c864

Please sign in to comment.