Closed tgtshanika closed 2 years ago
This can be achieved with a solr query group=true&group.field=name&group.ngroups=true&group.sort=version desc
However, with the default sorting, if we have API version as 1.0.0. 2.0.0 10.0.0 the latest version is selected as 2.0.0 instead of 10.0.0 because version is considered as a string
To fix the above issue it has introduced a new field in solr which sets a timestamp to each API version created. Based on that latest API version is fetched to display in the devportal when displayMultipleVersions config is not enabled.
Description
When showing APIs in Developer Portal, we are only showing the latest version when there are multiple API versions. But the APIs are not properly aligned into pages. The reason is that the filtering for latest version and pagination is done from the code level after retrieving APIs with versions from the DB (registry).
Solutions
APIs needs to be filtered properly (with the latest version) from the persistence level (Registry) itself.
There are a few ways we can check: