-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[DOCS] Reformat pattern_replace
token filter
#57699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOCS] Reformat pattern_replace
token filter
#57699
Conversation
Changes: * Rewrites description and adds Lucene link * Adds analyze example * Adds parameter definitions * Adds custom analyzer example
Pinging @elastic/es-search (:Search/Search) |
Pinging @elastic/es-docs (>docs) |
pattern_replace
tokenfilterpattern_replace
token filter docs
pattern_replace
token filter docspattern_replace
token filter
The `my_pattern_replace_filter` filter uses the regular expression `\\p{Sc}` to | ||
match and remove currency symbols, such as `£`, `€`, or `$`. The filter's `all` | ||
parameter is `false`, meaning only the first matching symbol in each token is | ||
removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know \\p{Sc}
was a thing so thanks for educating me :)
While these more esoteric functions work in token filters they are not supported in RegExp query syntax.
I wonder if it's worth doing one of two things here:
A) Add a footnote to the effect of "* note this particular expression wouldn't work with RegExp queries which use a different regex parser" or
B) Use a different example that works in both "pattern_replace" token filters and RegExp queries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @markharwood. With 992ab1c, I updated the example to use a pattern that compatible with the RegExp query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks, @jrodewig
Thanks @markharwood. |
Changes: * Rewrites description and adds Lucene link * Adds analyze example * Adds parameter definitions * Adds custom analyzer example
Changes: * Rewrites description and adds Lucene link * Adds analyze example * Adds parameter definitions * Adds custom analyzer example
Changes: * Rewrites description and adds Lucene link * Adds analyze example * Adds parameter definitions * Adds custom analyzer example
Changes: