Skip to content

[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

Merged
merged 5 commits into from
Jun 11, 2020
Merged

[DOCS] Reformat pattern_replace token filter #57699

merged 5 commits into from
Jun 11, 2020

Conversation

jrodewig
Copy link
Contributor

@jrodewig jrodewig commented Jun 4, 2020

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
@jrodewig jrodewig added >docs General docs changes :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.8.0 v7.9.0 v7.7.2 labels Jun 4, 2020
@jrodewig jrodewig requested a review from markharwood June 4, 2020 20:44
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jun 4, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (>docs)

@elasticmachine elasticmachine added the Team:Docs Meta label for docs team label Jun 4, 2020
@jrodewig jrodewig changed the title [DOCS] Reformat pattern_replace tokenfilter [DOCS] Reformat pattern_replace token filter docs Jun 5, 2020
@jrodewig jrodewig changed the title [DOCS] Reformat pattern_replace token filter docs [DOCS] Reformat pattern_replace token filter Jun 5, 2020
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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@jrodewig jrodewig requested a review from markharwood June 8, 2020 13:13
Copy link
Contributor

@markharwood markharwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks, @jrodewig

@jrodewig jrodewig merged commit bb66d59 into elastic:master Jun 11, 2020
@jrodewig jrodewig deleted the docs__reformat-pattern-replace-tokenfilter branch June 11, 2020 16:04
@jrodewig
Copy link
Contributor Author

Thanks @markharwood.

jrodewig added a commit that referenced this pull request Jun 11, 2020
Changes:

* Rewrites description and adds Lucene link
* Adds analyze example
* Adds parameter definitions
* Adds custom analyzer example
jrodewig added a commit that referenced this pull request Jun 11, 2020
Changes:

* Rewrites description and adds Lucene link
* Adds analyze example
* Adds parameter definitions
* Adds custom analyzer example
jrodewig added a commit that referenced this pull request Jun 11, 2020
Changes:

* Rewrites description and adds Lucene link
* Adds analyze example
* Adds parameter definitions
* Adds custom analyzer example
@jrodewig
Copy link
Contributor Author

Backport commits

master bb66d59
7.x c36df27
7.8 3255581
7.7 b41f285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes :Search/Search Search-related issues that do not fall into other categories Team:Docs Meta label for docs team Team:Search Meta label for search team v7.7.2 v7.8.0 v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants