The most frequently used token filter is the lowercase
filter, which does
exactly what you would expect; it transforms each token into its lowercase
form:
GET /_analyze?tokenizer=standard&filters=lowercase
The QUICK Brown FOX! (1)
Emits tokens the
, quick
, brown
, fox
It doesn’t matter whether users search for fox
or FOX
, as long as the same
analysis process is applied at query time and at search time. The lowercase
filter will transform a query for FOX
into a query for fox
, which is the
same token that we have stored in our inverted index.
To use token filters as part of the analysis process, we can create a custom
analyzer:
PUT /my_index
{
"settings": {
"analysis": {
"analyzer": {
"my_lowercaser": {
"tokenizer": "standard",
"filter": [ "lowercase" ]
}
}
}
}
}
And we can test it out with the analyze
API:
GET /my_index/_analyze?analyzer=my_lowercaser
The QUICK Brown FOX! (1)
Emits tokens the
, quick
, brown
, fox
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。