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

[Feature Request] Analyzers on non-text sub fields #11882

Open
lasiltan opened this issue Jan 15, 2024 · 1 comment
Open

[Feature Request] Analyzers on non-text sub fields #11882

lasiltan opened this issue Jan 15, 2024 · 1 comment
Labels
enhancement Enhancement or improvement to existing feature or request help wanted Extra attention is needed Indexing Indexing, Bulk Indexing and anything related to indexing

Comments

@lasiltan
Copy link

Is your feature request related to a problem? Please describe

In my domain, Every single type of document has an id that consists of two parts: id space and thei d itself, e.g. 31-111.
When trying to sort by id, I'd actually want to sort by the last part, numerically. Currently I cannot create an analyzer for a sub field (ie.g. d.number) that would index the id part as a long because analyzers work on strings.

Describe the solution you'd like

When the main field is a string (text, keyword) and the sub field is another type, you should be able to set an analyzer to the sub field. Opensearch should try to cast the result to the type of the sub field.

Related component

Indexing

Describe alternatives you've considered

Store the number part in a separate field.

  • It's not part of the data so the result is awkward.
  • The purpose of sub fields is to avoid this exact thing.

Script sorting

  • Performance becomes an issue.

Additional context

No response

@lasiltan lasiltan added enhancement Enhancement or improvement to existing feature or request untriaged labels Jan 15, 2024
@github-actions github-actions bot added the Indexing Indexing, Bulk Indexing and anything related to indexing label Jan 15, 2024
@peternied peternied added help wanted Extra attention is needed and removed untriaged labels Jan 17, 2024
@peternied
Copy link
Member

[Triage - attendees 1 2 3 4]
Thanks for filing, please feel free to submit a pull request for one of these analyzers that supports your scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request help wanted Extra attention is needed Indexing Indexing, Bulk Indexing and anything related to indexing
Projects
None yet
Development

No branches or pull requests

2 participants