Skip to content
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

document the new analysis-phonenumber plugin #8469

Merged

Conversation

rursprung
Copy link
Contributor

Description

this is part of opensearch-project/OpenSearch#11326. the actual implementation was done opensearch-project/OpenSearch#15915. see the commit message on the PR for further details.

Issues Resolved

resolves #8389

Version

this has been merged into 2.18.0 (opensearch-project/OpenSearch#16187).

Frontend features

n/a

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

github-actions bot commented Oct 4, 2024

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.

@rursprung
Copy link
Contributor Author

CC @reta

I admittedly haven't rendered this locally yet to have a look at the final result. i hope the links & rendering are ok!

@rursprung
Copy link
Contributor Author

@kolchfa-aws: i guess this is ready (except that i haven't built it locally to check the links; but i'll be OOO for the next couple of days, so i think it'd be best to get this moving even if i'm not around)

@kolchfa-aws kolchfa-aws added v2.18.0 release-notes PR: Include this PR in the automated release notes labels Oct 7, 2024
@kolchfa-aws
Copy link
Collaborator

Thank you, @rursprung! I think, for discoverability, it is best to put this information in the Text analysis section. Let me try to reorganize and push into this PR.

@kolchfa-aws
Copy link
Collaborator

@rursprung Doc review complete. Could you take a look and verify that my changes are accurate? It would be nice to provide a complete example (add a call to the _analyze endpoint and the OpenSearch response to see how the phone number is actually parsed).

this is part of opensearch-project/OpenSearch#11326. the actual
implementation was done opensearch-project/OpenSearch#15915. see the
commit message on the PR for further details.

resolves opensearch-project#8389

Co-authored-by: Fanit Kolchina <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: Ralph Ursprung <[email protected]>
@rursprung rursprung force-pushed the document-analysis-phone-plugin branch from 1333073 to d81da26 Compare October 11, 2024 14:09
@rursprung
Copy link
Contributor Author

thanks a lot for your contribution @kolchfa-aws!

i've added some examples, i hope they're ok in this form?

if you'd like you can test them yourself on a recent checkout of OpenSearch by running ./gradlew run -PinstalledPlugins="['analysis-phonenumber']" (the plugin has been merged into main and 2.x last week, this should work on either of these branches)

Signed-off-by: Fanit Kolchina <[email protected]>
@kolchfa-aws kolchfa-aws added the 5 - Editorial review PR: Editorial review in progress label Oct 11, 2024
Copy link
Collaborator

@kolchfa-aws kolchfa-aws left a comment

Choose a reason for hiding this comment

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

LGTM. Moving to editorial review.

Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

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

@kolchfa-aws @rursprung Please see my comments and changes and let me know if you have any questions. Thanks!

_analyzers/supported-analyzers/index.md Outdated Show resolved Hide resolved
_analyzers/supported-analyzers/phone-analyzers.md Outdated Show resolved Hide resolved
_analyzers/supported-analyzers/phone-analyzers.md Outdated Show resolved Hide resolved
_analyzers/supported-analyzers/phone-analyzers.md Outdated Show resolved Hide resolved
_analyzers/supported-analyzers/phone-analyzers.md Outdated Show resolved Hide resolved
_analyzers/supported-analyzers/phone-analyzers.md Outdated Show resolved Hide resolved
_analyzers/supported-analyzers/phone-analyzers.md Outdated Show resolved Hide resolved
_analyzers/supported-analyzers/phone-analyzers.md Outdated Show resolved Hide resolved
_analyzers/supported-analyzers/phone-analyzers.md Outdated Show resolved Hide resolved
_analyzers/supported-analyzers/phone-analyzers.md Outdated Show resolved Hide resolved
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
@kolchfa-aws
Copy link
Collaborator

@rursprung Editorial review complete. If you'd like to look over the changes, please do; otherwise, we're ready to merge.

Copy link
Contributor Author

@rursprung rursprung left a comment

Choose a reason for hiding this comment

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

thanks for your work!
just some minor things (most of which are about text which i wrote 🫣😅)


## Specifying a default region

You can optionally specify a default region for parsing phone numbers by providing the `phone-region` parameter within the analyzer. Valid phone regions are represented by ISO 3166 country codes. For more information, see [List of ISO 3166 country codes](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'm not a native speaker, but i'd have expected "[..] the list [..]" here? (it probably was me who wrote it like this in the first place? 🫣)

Suggested change
You can optionally specify a default region for parsing phone numbers by providing the `phone-region` parameter within the analyzer. Valid phone regions are represented by ISO 3166 country codes. For more information, see [List of ISO 3166 country codes](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes).
You can optionally specify a default region for parsing phone numbers by providing the `phone-region` parameter within the analyzer. Valid phone regions are represented by ISO 3166 country codes. For more information, see the [list of ISO 3166 country codes](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes).

Copy link
Collaborator

Choose a reason for hiding this comment

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

@rursprung Either way is correct 😄

},
"mappings": {
"properties": {
"phoneNumber": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw: do examples usually use camelCase, snake_case or kebab-case? this one currently uses kebab-case for the analyzer names (the actual phone-search analyzer does so too) and index name but camelCase for the field here (sorry, don't know how i ended up with this mix in this example)

Copy link
Collaborator

Choose a reason for hiding this comment

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

In general, OpenSearch uses snake_case in requests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so this should be phone_number? or is it not worth the effort to discuss this for the documentation? 😅

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally, it should all be snake case, so yes, phone_number is preferred. That said, even our own alerting plugin uses camel case. I think it would be nice to change to snake case 😄

```
{% include copy-curl.html %}

Is parsed into the following tokens:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i had is lowercase as it's the continuation of line 113. now it feels like a new sentence but isn't one (lacking a subject)

Copy link
Collaborator

@natebower natebower Oct 14, 2024

Choose a reason for hiding this comment

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

@rursprung I'm not a huge fan of the split-sentence structure, generally, and would prefer that we not use it because it results in this type of issue (case in point: I'd prefer that new lines/sentences/phrases not begin with lowercase letters).

@kolchfa-aws
Copy link
Collaborator

@rursprung @natebower I changed to phone_analyzer and rewrote the fragmented sentence, so we should be good to merge.

@kolchfa-aws kolchfa-aws merged commit a0e438f into opensearch-project:main Oct 22, 2024
5 checks passed
@rursprung rursprung deleted the document-analysis-phone-plugin branch October 22, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Editorial review PR: Editorial review in progress release-notes PR: Include this PR in the automated release notes v2.18.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC] new phone number analyzer plugin
4 participants