Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-28918

Search API does not sort alpha-numeric versions correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.33.1
    • Fix Version/s: 3.37.0
    • Component/s: REST, Search
    • Labels:

      Description

      A given component has these versions (from oldest to newest):

      1.0.0-alpha
      1.0.0-alpha.12
      1.0.0
      1.0.2
      1.0.3
      1.0.4

      where version 1.0.0 was released after the -alpha versions.

      However, the Search API returns the following:

      curl -s -u admin:admin123 "http://localhost:8081/service/rest/v1/search?sort=version&direction=desc&repository=maven-releases&group=johnkr&name=test&version=1.0.*" | jq -r '.items[].version'
      1.0.4
      1.0.3
      1.0.2
      1.0.0-alpha.12
      1.0.0
      1.0.0-alpha

      curl -s -u admin:admin123 "http://localhost:8081/service/rest/v1/search?sort=version&direction=asc&repository=maven-releases&group=johnkr&name=test&version=1.0.*" | jq -r '.items[].version'
      1.0.0
      1.0.0-alpha
      1.0.0-alpha.12
      1.0.2
      1.0.3
      1.0.4

      The Search API should respect non-numeric version formats.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jhill Joshua Hill
              Reporter:
              jkruger John Kruger
              CC:
              Docterryome Wilkins
              Last Updated By:
              Joshua Hill Joshua Hill
              Team:
              NXRM - Neo
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title