原英文版地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/analysis-reverse-tokenfilter.html, 原文档版权归 www.elastic.co 所有
本地英文版地址: ../en/analysis-reverse-tokenfilter.html
本地英文版地址: ../en/analysis-reverse-tokenfilter.html
重要: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 当前版本文档。
Reverse token filteredit
Reverses each token in a stream. For example, you can use the reverse
filter
to change cat
to tac
.
Reversed tokens are useful for suffix-based searches,
such as finding words that end in -ion
or searching file names by their
extension.
This filter uses Lucene’s ReverseStringFilter.
Exampleedit
The following analyze API request uses the reverse
filter to reverse each token in quick fox jumps
:
GET _analyze { "tokenizer" : "standard", "filter" : ["reverse"], "text" : "quick fox jumps" }
The filter produces the following tokens:
[ kciuq, xof, spmuj ]
Add to an analyzeredit
The following create index API request uses the
reverse
filter to configure a new
custom analyzer.
PUT reverse_example { "settings" : { "analysis" : { "analyzer" : { "whitespace_reverse" : { "tokenizer" : "whitespace", "filter" : ["reverse"] } } } } }