geonetwork-ui icon indicating copy to clipboard operation
geonetwork-ui copied to clipboard

[datahub] sort datasets by title

Open alexarobu opened this issue 1 year ago • 3 comments

At the moment you can only sort the search results (i.e. datasets) by Relevancy, Last updates or Popularity. Quite a common sort option is the title (i.e. sorting the results in alphabetical order). Would it be possible to have that added in?

image

alexarobu avatar May 10 '23 11:05 alexarobu

The sort options could absolutely be made configurable. They are currently hardcoded here: https://github.com/geonetwork/geonetwork-ui/blob/main/libs/feature/search/src/lib/sort-by/sort-by.component.ts

On the other hand, please note that sorting records by name might be a bit counter-intuitive as there are no real pagination for the search results, but instead a "show more" option. So reaching the last records this way might be combersome.

jahow avatar May 10 '23 11:05 jahow

I see what you mean, but presumably, a user wouldn't just want to reach the last record without any filtering or search term so it would mean that the list of records is already reduced I think.

I had a play with https://github.com/geonetwork/geonetwork-ui/blob/main/libs/feature/search/src/lib/sort-by/sort-by.component.ts sometime ago, but the best I could make it do was to sort alphabetically but in reverse (so from Z to A)- which as you can tell is close, but not quite the result I was after :joy:

alexarobu avatar May 10 '23 11:05 alexarobu

Strange! but yes definitely an interesting feature. Please ask here or open a discussion on Github if you need pointers or opinions before implementing something.

jahow avatar May 10 '23 11:05 jahow