-
Notifications
You must be signed in to change notification settings - Fork 507
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
[DOC] Character filters - Pattern replace #8557
[DOC] Character filters - Pattern replace #8557
Conversation
Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Editorial review -> Merged. Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a maintainer. When you're ready for doc review, tag the assignee of this PR. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference). The doc reviewer will arrange for an editorial review. |
@udabhas @varun-lodaya Please provide tech review approval to move this PR forward in the documentation process. Please ensure content and code examples are relevant and accurate. Thank you. |
Running this `pattern replace` filter to remove spaces, dashes, and parentheses by replacing the pattern `[\\s()-]+` with an empty string will result in the following text: | ||
|
||
``` | ||
Call me at 5551234567 or 5559876543 |
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.
This won't be the out put as we are relacing all the whitespaces with ""
Correct output would be concatenated string
Callmeat5551234567or5559876543
Signed-off-by: Fanit Kolchina <[email protected]>
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.
@kolchfa-aws @leanneeliatra Please see my comments and changes and let me know if you have any questions. Thanks!
_analyzers/character-filters/pattern-replace-character-filter.md
Outdated
Show resolved
Hide resolved
_analyzers/character-filters/pattern-replace-character-filter.md
Outdated
Show resolved
Hide resolved
_analyzers/character-filters/pattern-replace-character-filter.md
Outdated
Show resolved
Hide resolved
|
||
## Using capturing groups | ||
|
||
You can use capturing groups in `replacement`. For example, the following request creates a custom analyzer that uses a `pattern_replace` character filter to replace hyphens with dots in phone numbers: |
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.
"in replacement
" => "with the replacement
parameter"?
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.
"in" is better. Reworded.
_analyzers/character-filters/pattern-replace-character-filter.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: kolchfa-aws <[email protected]>
* doc: addition of pattern replace charachter filter page Signed-off-by: [email protected] <[email protected]> * Doc review Signed-off-by: Fanit Kolchina <[email protected]> * Apply suggestions from code review Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> --------- Signed-off-by: [email protected] <[email protected]> Signed-off-by: Fanit Kolchina <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> Co-authored-by: Fanit Kolchina <[email protected]> Co-authored-by: kolchfa-aws <[email protected]> Co-authored-by: Nathan Bower <[email protected]> (cherry picked from commit 7a5ba5c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Updating the OpenSearch documentation to include a page on Pattern Replace filters in the Character filter analyzers section.
Issues Resolved
Part of #1483 addressed in this PR.
Version
all
Frontend features
n/a
Checklist
For more information on following Developer Certificate of Origin and signing off your commits, please check here.