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 an uppercase
filter:
PUT /uppercase_example
{
"settings": {
"analysis": {
"filter": {
"uppercase_filter": {
"type": "uppercase"
}
},
"analyzer": {
"uppercase_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"uppercase_filter"
]
}
}
}
}
}
copy
Generated tokens
Use the following request to examine the tokens generated using the analyzer:
GET /uppercase_example/_analyze
{
"analyzer": "uppercase_analyzer",
"text": "OpenSearch is powerful"
}
copy
The response contains the generated tokens:
{
"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
}
]
}
当前内容版权归 OpenSearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 OpenSearch .