-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add uppercase token filter docs #8452
Signed-off-by: Anton Rubin <[email protected]>
- Loading branch information
1 parent
76486a4
commit 8d43849
Showing
2 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
layout: default | ||
title: Uppercase | ||
parent: Token filters | ||
nav_order: 460 | ||
--- | ||
|
||
# Uppercase token filter | ||
|
||
The `uppercase` token filter is used to convert all tokens (words) to uppercase during analysis. | ||
|
||
## Example | ||
|
||
The following example request creates a new index named `uppercase_example` and configures an analyzer with `uppercase` filter: | ||
|
||
```json | ||
PUT /uppercase_example | ||
{ | ||
"settings": { | ||
"analysis": { | ||
"filter": { | ||
"uppercase_filter": { | ||
"type": "uppercase" | ||
} | ||
}, | ||
"analyzer": { | ||
"uppercase_analyzer": { | ||
"type": "custom", | ||
"tokenizer": "standard", | ||
"filter": [ | ||
"lowercase", | ||
"uppercase_filter" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
{% include copy-curl.html %} | ||
|
||
## Generated tokens | ||
|
||
Use the following request to examine the tokens generated using the analyzer: | ||
|
||
```json | ||
GET /uppercase_example/_analyze | ||
{ | ||
"analyzer": "uppercase_analyzer", | ||
"text": "OpenSearch is powerful" | ||
} | ||
``` | ||
{% include copy-curl.html %} | ||
|
||
The response contains the generated tokens: | ||
|
||
```json | ||
{ | ||
"tokens": [ | ||
{ | ||
"token": "OPENSEARCH", | ||
"start_offset": 0, | ||
"end_offset": 10, | ||
"type": "<ALPHANUM>", | ||
"position": 0 | ||
}, | ||
{ | ||
"token": "IS", | ||
"start_offset": 11, | ||
"end_offset": 13, | ||
"type": "<ALPHANUM>", | ||
"position": 1 | ||
}, | ||
{ | ||
"token": "POWERFUL", | ||
"start_offset": 14, | ||
"end_offset": 22, | ||
"type": "<ALPHANUM>", | ||
"position": 2 | ||
} | ||
] | ||
} | ||
``` |