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

Length of string field characters #31733

Open
tarashchuk opened this issue Jun 26, 2024 · 4 comments
Open

Length of string field characters #31733

tarashchuk opened this issue Jun 26, 2024 · 4 comments
Assignees
Milestone

Comments

@tarashchuk
Copy link

Can you please add function for ranking feature with get Length of string field characters. Also it will be great to have length of all characters of terms or something like this.

@jobergum
Copy link
Member

jobergum commented Jul 2, 2024

Could you add examples to clarify what you are asking for? The length of a string can be computed by you and added as an attribute field to be used in ranking.

schema foo {
   document foo {
       field bar type string{}
       field bar_length type int{}
    }
}```

@tarashchuk
Copy link
Author

@jobergum agree, but we discussed about ability to calculate it in ranking feature without adding a new field.

@jobergum
Copy link
Member

jobergum commented Jul 2, 2024

IMHO; We don't want to add a general feature that keeps track of character length of strings to be accessed in ranking because:

  • Things you access randomly in ranking expressions should be in memory (defined with attribute) for meaningful performance
  • Adding character length for all string fields can easily be added by the application on a per field basis.

@kkraune
Copy link
Member

kkraune commented Jul 3, 2024

another idea: add to indexing language, populate a synthetic field with length of input field (in tokens? characters? bytes?)

@kkraune kkraune added this to the later milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants