Skip to content

Use custom strings ordering when sorting #2223

@pstibrany

Description

@pstibrany

We would like to use custom ordering function when sorting matched documents. Right now ordering uses simple Go string comparison, but we would prefer to use ordering by using Collator (or more generally by custom Less function).

How would you suggest to implement such feature?

I see at least two possibilities:

  • change SortOrder type into a struct with Less function.
  • keep SortOrder as-is (slice), but change SortOrder.Compare function to take explicit Less function. This would require propagation of Less function from SearchRequest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions