Package Search Results - Fetch Package Search Results

提供搜尋文字的一組結果。

POST https://almsearch.dev.azure.com/{organization}/_apis/search/packagesearchresults?api-version=7.1-preview.1

URI 參數

名稱 位於 必要 類型 Description
organization
path True

string

Azure DevOps 組織的名稱。

api-version
query True

string

要使用的 API 版本。 這應該設定為 '7.1-preview.1' 以使用此版本的 API。

要求本文

名稱 類型 Description
$orderBy

SortOption[]

排序搜尋結果的選項。 如果設定為 null,則會依相關性傳回結果。 如果提供多個排序選項,結果會依 OrderBy 中指定的順序排序。

$skip

integer

要略過的結果數目。

$top

integer

要傳回的結果數目。

filters

object

要套用的篩選。 如果沒有要套用的篩選準則,請將它設定為 null。

includeFacets

boolean

旗標以選擇結果中的 Facet。 預設行為為 false。

searchText

string

搜尋的文字。

回應

名稱 類型 Description
200 OK

PackageSearchResponseContent

成功的作業

Headers

ActivityId: string

安全性

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

名稱 Description
vso.packaging 授與讀取摘要和套件的能力。 同時授與搜尋套件的能力。

範例

Sample Request

POST https://almsearch.dev.azure.com/{organization}/_apis/search/packagesearchresults?api-version=7.1-preview.1

{
  "$skip": 0,
  "$top": 50,
  "$orderBy": null,
  "includeFacets": true,
  "searchText": "microsoft applicationinsight package",
  "filters": {
    "Feeds": [
      "ApplicationInsights-Team"
    ],
    "View": [
      "local"
    ],
    "ProtocolType": [
      "Nuget",
      "Npm"
    ]
  }
}

Sample Response

{
  "count": 3,
  "results": [
    {
      "name": "@microsoft/applicationinsights-mezzurite",
      "id": "0adc5b40-8b48-4a42-ac5e-93da78206d27",
      "description": "Logging Extention for Mezzurtie Timing Package",
      "protocolType": "Npm",
      "feeds": [
        {
          "collectionId": "0efb4611-d565-4cd1-9a64-7d6cb6d7d5f0",
          "collectionName": "mseng",
          "feedId": "cd3f7228-b239-4ef5-8d3b-ee9c3bc79bc2",
          "feedName": "ApplicationInsights-Team",
          "packageUrl": "https://dev.azure.com/mseng/_packaging?feed=ApplicationInsights-Team&_a=package&package=@microsoft/applicationinsights-mezzurite&version=1.0.0&protocolType=Npm",
          "latestVersion": "1.0.0",
          "latestMatchedVersion": "1.0.0",
          "views": [
            "local"
          ]
        }
      ],
      "hits": [
        {
          "fieldReferenceName": "name",
          "highlights": [
            "@<highlighthit>microsoft</highlighthit>/<highlighthit>applicationinsights</highlighthit>-mezzurite"
          ]
        },
        {
          "fieldReferenceName": "description",
          "highlights": [
            "Logging Extention for Mezzurtie Timing <highlighthit>Package</highlighthit>"
          ]
        }
      ]
    },
    {
      "name": "Microsoft.ApplicationInsights.Masi.Tracing",
      "id": "5b709505-a14f-4d2c-b172-21f1e6fc0562",
      "description": "The MASI tracing package allowing you to send log messages with activity context to Application Insights and to Windows Azure Diagnostics easily",
      "protocolType": "NuGet",
      "feeds": [
        {
          "collectionId": "0efb4611-d565-4cd1-9a64-7d6cb6d7d5f0",
          "collectionName": "mseng",
          "feedId": "cd3f7228-b239-4ef5-8d3b-ee9c3bc79bc2",
          "feedName": "ApplicationInsights-Team",
          "packageUrl": "https://dev.azure.com/mseng/_packaging?feed=ApplicationInsights-Team&_a=package&package=Microsoft.ApplicationInsights.Masi.Tracing&version=1.0.13.2-build00132-2&protocolType=NuGet",
          "latestVersion": "1.0.13.2-build00132-2",
          "latestMatchedVersion": "1.0.13.2-build00132-2",
          "views": [
            "local"
          ]
        }
      ],
      "hits": [
        {
          "fieldReferenceName": "name",
          "highlights": [
            "<highlighthit>Microsoft</highlighthit>.<highlighthit>ApplicationInsights</highlighthit>.Masi.Tracing"
          ]
        },
        {
          "fieldReferenceName": "description",
          "highlights": [
            "The MASI tracing <highlighthit>package</highlighthit> allowing you to send log messages with activity context to Application"
          ]
        }
      ]
    },
    {
      "name": "Microsoft.ApplicationInsights.Agent.StartupTask",
      "id": "60c357c1-69bf-4c9b-8fe0-a8ad7e50a5f9",
      "description": "Application Insights Agent startup task. This package adds a startup task for installing Application Insights Agent to enable additional Application Insights Telemetry.",
      "protocolType": "NuGet",
      "feeds": [
        {
          "collectionId": "0efb4611-d565-4cd1-9a64-7d6cb6d7d5f0",
          "collectionName": "mseng",
          "feedId": "cd3f7228-b239-4ef5-8d3b-ee9c3bc79bc2",
          "feedName": "ApplicationInsights-Team",
          "packageUrl": "https://dev.azure.com/mseng/_packaging?feed=ApplicationInsights-Team&_a=package&package=Microsoft.ApplicationInsights.Agent.StartupTask&version=1.0.5&protocolType=NuGet",
          "latestVersion": "1.0.5",
          "latestMatchedVersion": "1.0.5",
          "views": [
            "local"
          ]
        }
      ],
      "hits": [
        {
          "fieldReferenceName": "name",
          "highlights": [
            "<highlighthit>Microsoft</highlighthit>.<highlighthit>ApplicationInsights</highlighthit>.Agent.StartupTask"
          ]
        },
        {
          "fieldReferenceName": "description",
          "highlights": [
            "This <highlighthit>package</highlighthit> adds a startup task for installing Application Insights Agent to enable additional"
          ]
        }
      ]
    }
  ],
  "infoCode": 0,
  "facets": {
    "ProtocolType": [
      {
        "name": "Npm",
        "id": "Npm",
        "resultCount": 1
      },
      {
        "name": "NuGet",
        "id": "NuGet",
        "resultCount": 2
      }
    ],
    "Feeds": [
      {
        "name": "ApexPreRelease",
        "id": "ApexPreRelease",
        "resultCount": 4
      },
      {
        "name": "ApplicationInsights-dotnet-develop",
        "id": "ApplicationInsights-dotnet-develop",
        "resultCount": 3
      },
      {
        "name": "ApplicationInsights-Team",
        "id": "ApplicationInsights-Team",
        "resultCount": 3
      },
      {
        "name": "ArtifactTool",
        "id": "ArtifactTool",
        "resultCount": 1
      },
      {
        "name": "Axon.Dependencies",
        "id": "Axon.Dependencies",
        "resultCount": 4
      },
      {
        "name": "CloudBuild",
        "id": "CloudBuild",
        "resultCount": 1
      },
      {
        "name": "CloudBuildTest",
        "id": "CloudBuildTest",
        "resultCount": 1
      },
      {
        "name": "CodeFlow",
        "id": "CodeFlow",
        "resultCount": 3
      },
      {
        "name": "Codex-Deps",
        "id": "Codex-Deps",
        "resultCount": 4
      },
      {
        "name": "Kusto-Internal",
        "id": "Kusto-Internal",
        "resultCount": 4
      },
      {
        "name": "MSCredProvider",
        "id": "MSCredProvider",
        "resultCount": 2
      },
      {
        "name": "VS",
        "id": "VS",
        "resultCount": 7
      },
      {
        "name": "VsoMicrosoftExternals",
        "id": "VsoMicrosoftExternals",
        "resultCount": 3
      }
    ],
    "View": [
      {
        "name": "Local",
        "id": "Local",
        "resultCount": 3
      }
    ]
  }
}

定義

名稱 Description
FeedInfo

定義摘要的詳細資料。

PackageHit

在封裝結果的 欄位中定義相符的詞彙。

PackageResult

定義符合套件搜尋要求的封裝結果。

PackageSearchRequest

定義套件搜尋要求。

PackageSearchResponseContent

定義針對套件搜尋要求傳回的回應專案。

SortOption

定義如何排序結果。

FeedInfo

定義摘要的詳細資料。

名稱 類型 Description
collectionId

string

集合的識別碼。

collectionName

string

集合的名稱。

feedId

string

摘要的識別碼。

feedName

string

摘要的名稱。

latestMatchedVersion

string

此摘要中套件的最新相符版本。

latestVersion

string

此摘要中的最新版本套件。

packageUrl

string

此摘要中的套件 URL。

views

string[]

包含相符套件的檢視清單。

PackageHit

在封裝結果的 欄位中定義相符的詞彙。

名稱 類型 Description
fieldReferenceName

string

醒目提示欄位的參考名稱。

highlights

string[]

欄位的相符/反白顯示程式碼片段。

PackageResult

定義符合套件搜尋要求的封裝結果。

名稱 類型 Description
description

string

封裝的描述。

feeds

FeedInfo[]

包含相符套件的摘要清單。

hits

PackageHit[]

相符專案的醒目提示欄位清單。

id

string

封裝的識別碼。

name

string

封裝的名稱。

protocolType

string

封裝的類型。

PackageSearchRequest

定義套件搜尋要求。

名稱 類型 Description
$orderBy

SortOption[]

排序搜尋結果的選項。 如果設定為 null,則會依相關性傳回結果。 如果提供多個排序選項,結果會依 OrderBy 中指定的順序排序。

$skip

integer

要略過的結果數目。

$top

integer

要傳回的結果數目。

filters

object

要套用的篩選。 如果沒有要套用的篩選準則,請將它設定為 null。

includeFacets

boolean

旗標以選擇結果中的 Facet。 預設行為為 false。

searchText

string

搜尋的文字。

PackageSearchResponseContent

定義針對套件搜尋要求傳回的回應專案。

名稱 類型 Description
count

integer

相符套件的總數。

facets

object

字典,針對每個 Facet 儲存物件的陣列 Filter

infoCode

integer

指出任何其他資訊的數值代碼:0 - 確定,1 - 帳戶正在重新編制索引,2 - 帳戶索引尚未啟動,3 - 不支援前置詞萬用字元查詢,5 - 不支援程式碼 Facet 的 MultiWords,6 - 帳戶正在上線,7 - 帳戶已上線或重新編制索引,8 - 已修剪為允許 maxresult 的 Top 值 9 - 正在編制索引分支, 10 - 未啟用 Facet、11 - 無法存取工作專案、19 - 不支援程式碼類型篩選的片語查詢、20 - 不支援程式碼類型篩選的萬用字元查詢。 任何其他資訊程式碼都用於內部用途。

results

PackageResult[]

相符套件的清單。

SortOption

定義如何排序結果。

名稱 類型 Description
field

string

應該執行排序的功能變數名稱。

sortOrder

string

排序 (ASC/DESC) ,其中應該排序結果。