---
title: "Semantic Version Search"
description: ""
canonical_url: "https://cloudsmith.com/changelog/semantic-version-search"
last_updated: "2020-06-19T15:49:00.000Z"
---
# Semantic Version Search

Introducing fully-semantic version searching for packages; via the UI, API, CLI and entitlement tokens.

```json
{
  "_key": "9fcaa0e9c1cb",
  "_type": "image",
  "asset": {
    "_createdAt": "2025-02-06T17:17:37Z",
    "_id": "image-b08027b4db242dce3cd1a6d49c40088642195a13-1181x799-jpg",
    "_rev": "NEKsnepw9vPdlHVFnQGxG7",
    "_type": "sanity.imageAsset",
    "_updatedAt": "2025-02-06T17:17:37Z",
    "assetId": "b08027b4db242dce3cd1a6d49c40088642195a13",
    "extension": "jpg",
    "metadata": {
      "_type": "sanity.imageMetadata",
      "blurHash": "V9SZ2-jLD%s:Rk56s=S2s:t8NxsmR,oejI_NskjvobjG",
      "dimensions": {
        "_type": "sanity.imageDimensions",
        "aspectRatio": 1.4780976220275344,
        "height": 799,
        "width": 1181
      },
      "hasAlpha": false,
      "isOpaque": true,
      "lqip": "data:image/jpeg;base64,/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAANABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAMFBAj/xAAfEAABBAICAwAAAAAAAAAAAAADAAECEQQhEjETM6L/xAAUAQEAAAAAAAAAAAAAAAAAAAAB/8QAGBEAAwEBAAAAAAAAAAAAAAAAAAERElH/2gAMAwEAAhEDEQA/AOlQhMwpeQjm5Ppq6TyCI8YxpnvutUtGL6k1LdCE6OLOtx+kKihFfQwj/9k=",
      "palette": {
        "_type": "sanity.imagePalette",
        "darkMuted": {
          "_type": "sanity.imagePaletteSwatch",
          "background": "#506c47",
          "foreground": "#fff",
          "population": 0.08,
          "title": "#fff"
        },
        "darkVibrant": {
          "_type": "sanity.imagePaletteSwatch",
          "background": "#34547c",
          "foreground": "#fff",
          "population": 0,
          "title": "#fff"
        },
        "dominant": {
          "_type": "sanity.imagePaletteSwatch",
          "background": "#98d0e9",
          "foreground": "#000",
          "population": 0.41,
          "title": "#fff"
        },
        "lightMuted": {
          "_type": "sanity.imagePaletteSwatch",
          "background": "#a3ceac",
          "foreground": "#000",
          "population": 0.03,
          "title": "#fff"
        },
        "lightVibrant": {
          "_type": "sanity.imagePaletteSwatch",
          "background": "#98d0e9",
          "foreground": "#000",
          "population": 0.41,
          "title": "#fff"
        },
        "muted": {
          "_type": "sanity.imagePaletteSwatch",
          "background": "#5681a4",
          "foreground": "#fff",
          "population": 0.1,
          "title": "#fff"
        },
        "vibrant": {
          "_type": "sanity.imagePaletteSwatch",
          "background": "#4c94d4",
          "foreground": "#fff",
          "population": 0,
          "title": "#fff"
        }
      }
    },
    "mimeType": "image/jpeg",
    "originalFilename": "pictures-4.jpg",
    "path": "images/rafvlnhi/production/b08027b4db242dce3cd1a6d49c40088642195a13-1181x799.jpg",
    "sha1hash": "b08027b4db242dce3cd1a6d49c40088642195a13",
    "size": 62505,
    "uploadId": "9rV52J80LNoXJiA5JrMDPIx05wLm9IYk",
    "url": "https://cdn.sanity.io/images/rafvlnhi/production/b08027b4db242dce3cd1a6d49c40088642195a13-1181x799.jpg"
  },
  "link": null,
  "markDefs": null
}
```

With semantic versions, Cloudsmith understands the difference between versions, in terms of how a version is represented. For example, we know that **10.2.0** is MAJOR version **10**, MINOR version **2** and PATCH version **0** and that **10.2.0** is a higher version than **9.3.1**.

Leveraging this, you can now use relational operators, such as **>** (greater-than), **>=** (greater-than or equal-to), **<** (less-than), and **<=** (less-than or equal-to), when searching for versions. Combined with our boolean search, that means more power than ever before to find the packages you need.

We've also introduced the popular "pessimistic operator", as **~=**, which allows you to search for versions that are greater-than or equal-to a specific version, up to versions that are less than the next incompatible level. E.g. **version:~=1.2.0** will allow versions between **1.2.0** up to **1.3.0**.

This might be most interesting to vendors, who want to sell licenses for a particular version-line of their product and allow customers only access to that range. E.g. For customer purchases a "1.x" edition, that wouldn't give access to "2.x" or beyond. The vendor would use **version:~=1.0** as their entitlement restriction.

**Tip:** If you have any unexpected issues with the semantic version search, you can go back to string-based searching by including globs (*****) in your expression, or by using **^** to match the start of the version or **$** to match the end of the version. E.g. **version:^1.0.0$** will match **1.0.0** exactly, by string-based matching.

_Sound awesome?_ Let us know what you think!

[Find out more](https://help.cloudsmith.io/docs/search-packages)
