Package Search Results - Fetch Package Search Results
提供一組搜尋文字的結果。
POST https://almsearch.dev.azure.com/{organization}/_apis/search/packagesearchresults?api-version=7.1
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
organization
|
path | True |
string |
Azure DevOps 組織的名稱。 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。 |
要求本文
| 名稱 | 類型 | Description |
|---|---|---|
| $orderBy |
排序搜尋結果的選項。 如果設定為 null,則會依相關性傳回結果。 如果提供多個排序選項,結果會依照 OrderBy 中指定的順序排序。 |
|
| $skip |
integer (int32) |
要略過的結果數目。 |
| $top |
integer (int32) |
要傳回的結果數目。 |
| filters |
object |
要套用的篩選條件。 如果沒有要套用的篩選條件,請將它設定為 null。 |
| includeFacets |
boolean |
旗標以在結果中選擇多面向。 默認行為為 false。 |
| searchText |
string |
搜尋文字。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
成功作業 標題 ActivityId: string |
安全性
oauth2
類型:
oauth2
Flow:
accessCode
授權 URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
權杖 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
範圍
| 名稱 | Description |
|---|---|
| vso.packaging | 授與讀取摘要和套件的能力。 同時授與搜尋套件的能力。 |
範例
範例要求
POST https://almsearch.dev.azure.com/{organization}/_apis/search/packagesearchresults?api-version=7.1
{
"$skip": 0,
"$top": 50,
"$orderBy": null,
"includeFacets": true,
"searchText": "microsoft applicationinsight package",
"filters": {
"Feeds": [
"ApplicationInsights-Team"
],
"View": [
"local"
],
"ProtocolType": [
"Nuget",
"Npm"
]
}
}
範例回覆
{
"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 |
|---|---|
|
Feed |
定義摘要的詳細數據。 |
|
Package |
定義封裝結果欄位中相符的字詞。 |
|
Package |
定義符合套件搜尋要求的套件結果。 |
|
Package |
定義套件搜尋要求。 |
|
Package |
定義針對套件搜尋要求傳回的響應專案。 |
|
Sort |
定義如何排序結果。 |
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 |
Feed |
包含相符套件的摘要清單。 |
| hits |
相符專案的醒目提示欄位清單。 |
|
| id |
string |
封裝的標識碼。 |
| name |
string |
封裝的名稱。 |
| protocolType |
string |
封裝的類型。 |
PackageSearchRequest
定義套件搜尋要求。
| 名稱 | 類型 | Description |
|---|---|---|
| $orderBy |
排序搜尋結果的選項。 如果設定為 null,則會依相關性傳回結果。 如果提供多個排序選項,結果會依照 OrderBy 中指定的順序排序。 |
|
| $skip |
integer (int32) |
要略過的結果數目。 |
| $top |
integer (int32) |
要傳回的結果數目。 |
| filters |
object |
要套用的篩選條件。 如果沒有要套用的篩選條件,請將它設定為 null。 |
| includeFacets |
boolean |
旗標以在結果中選擇多面向。 默認行為為 false。 |
| searchText |
string |
搜尋文字。 |
PackageSearchResponseContent
定義針對套件搜尋要求傳回的響應專案。
| 名稱 | 類型 | Description |
|---|---|---|
| count |
integer (int32) |
相符套件的總數。 |
| facets |
object |
字典,針對每個 Facet 儲存 |
| infoCode |
integer (int32) |
數值程式代碼,指出任何其他資訊:0 - 確定,1 - 帳戶正在重新編製索引,2 - 帳戶索引尚未啟動,3 - 不支援前置詞通配符查詢,5 - 不支援程式代碼 Facet 的多字詞,6 - 帳戶正在上線或重新編製索引,8 - 允許的 Maxresult 允許的最大值 9 - 分支正在編製索引, 10 - 未啟用 Faceting、11 - 無法存取的工作專案、19 - 不支援程式代碼類型篩選的片語查詢、20 - 不支援程式代碼類型篩選的通配符查詢。 任何其他資訊程式代碼都用於內部用途。 |
| results |
相符套件的清單。 |
SortOption
定義如何排序結果。
| 名稱 | 類型 | Description |
|---|---|---|
| field |
string |
應該執行排序的功能變數名稱。 |
| sortOrder |
string |
排序結果的順序(ASC/DESC)。 |