Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini
berlaku untuk Apigee dan Apigee hybrid.
Topik ini menjelaskan cara menggunakan Penelusuran Semantik yang didukung oleh Vertex AI dan opsi penelusuran berbasis filter untuk menelusuri
resource tertentu di API hub.
Gambar 1. API hub menyediakan fitur penelusuran dan pemfilteran bahasa alami yang canggih.
Hub Search API menggunakan Penelusuran Semantik
Anda dapat dengan mudah menemukan dan melihat resource API yang terdaftar di API Hub menggunakan Penelusuran Semantik. Penelusuran Semantik memungkinkan
Anda menelusuri semua resource API yang tersedia di instance menggunakan kueri penelusuran teks bebas. Anda dapat menelusuri semua jenis entitas (API, operasi API, spesifikasi, dan lainnya.),
atau tentukan jenis entity yang ingin Anda buat kuerinya.
Dengan mesin telusur Vertex AI, Semantic Search dapat melakukan lebih dari sekadar "pencocokan" istilah. Penelusuran Semantik menampilkan hasil
yang berisi istilah yang ditemukan di mana saja dalam entri resource API mendetail yang secara semantik mirip dengan kueri penelusuran teks bebas yang dimasukkan.
Penelusuran teks bebas menampilkan kategori hasil berikut:
API: Daftar API yang cocok dengan penelusuran. Untuk setiap API, detail berikut
disediakan:
Nama API dengan link ke halaman detail API.
Deskripsi singkat tentang resource.
Nama dan alamat email pemilik resource.
Versions: Daftar versi API yang cocok dengan penelusuran. Untuk setiap versi, detail berikut
disediakan:
Nama API yang terkait dengan versi, dengan link yang mengarahkan Anda ke
halaman detail API.
Nama versi API, dengan link yang mengarahkan Anda ke halaman detail versi.
Deskripsi versi dan metadata terkait.
Spesifikasi: Daftar spesifikasi API yang cocok dengan penelusuran. Untuk setiap spesifikasi, detail berikut
diberikan:
Nama API yang terkait dengan spesifikasi, dengan link yang mengarahkan Anda ke halaman detail API.
Nama spesifikasi API, dengan link yang mengarahkan Anda ke halaman detail versi yang terkait dengan spesifikasi.
Deskripsi spesifikasi.
Link ke dokumen spesifikasi.
Jenis spesifikasi, seperti spesifikasi OpenAPI.
Operasi: Daftar operasi API yang cocok dengan penelusuran. Untuk setiap operasi, detail berikut
disediakan:
Nama API yang terkait dengan operasi, dengan link yang mengarahkan Anda ke halaman detail API.
Nama operasi, dengan link yang mengarahkan Anda ke halaman detail versi yang terkait
dengan operasi.
Deskripsi spesifikasi.
Link ke dokumen spesifikasi yang menentukan operasi.
Link ke versi yang menyertakan operasi.
Deployment: Daftar deployment yang cocok dengan penelusuran. Untuk setiap deployment, detail berikut akan
diberikan:
Nama deployment.
Deskripsi deployment.
Jenis deployment. Misalnya, Apigee Hybrid.
Link ke versi yang menyertakan deployment.
Untuk menelusuri API yang berisi istilah tertentu:
Di konsol Google Cloud, buka halaman Penelusuran semantik di API hub.
Misalnya, Anda dapat memasukkan "API pengelolaan pesanan" atau "File spesifikasi untuk setelan operator nirkabel".
Anda dapat menyaring penelusuran menggunakan atribut sistem dalam perintah kueri penelusuran. Jika Anda membuat atribut pengguna saat mendaftarkan API di API Hub, Anda juga dapat menyertakan atribut ini dalam perintah kueri penelusuran.
Hasil penelusuran dikategorikan dalam tab berikut: API, Versi, Spesifikasi, Operasi, dan Deployment. Klik salah satu tab untuk melihat hasil untuk kategori. Hasilnya menampilkan resource API yang berisi istilah yang secara semantik mirip dengan kueri penelusuran yang Anda masukkan.
Klik nama resource API untuk melihat halaman detail resource.
Untuk menghapus kueri saat ini, klik Hapus hasil.
Menelusuri API hub menggunakan API
Anda juga dapat menelusuri resource API hub menggunakan API API hub. Metode searchResources
memungkinkan Anda membuat kueri resource API hub menggunakan kueri dan filter teks bebas.
Anda dapat menggunakan panggilan API berikut untuk menelusuri seluruh resource API hub:
PROJECT_ID adalah ID project host untuk instance API Hub Anda.
LOCATION adalah lokasi tempat instance API Hub Anda dihosting.
QUERY adalah kueri teks bebas yang akan digunakan dalam penelusuran. Kueri dapat berisi kata kunci
yang terkait dengan detail resource hub API, termasuk nama tampilan, deskripsi, atau metadata lainnya.
RESOURCE_TYPE adalah filter opsional yang ditentukan untuk penelusuran Anda. Anda dapat menentukan salah satu jenis resource API hub berikut sebagai filter:
Api
ApiOperation
Deployment
Definition
Spec
Version
Contoh:
curl-XPOSThttps://apihub.googleapis.com/v1/projects/{project-id}/locations/{location}:searchResources \-H"Authorization: Bearer $(gcloud auth print-access-token)"-H"Content-Type: application/json"\
-d'{"query":"dog status in the store","filter":"resource_type = SPEC"}'
Panggilan ini menampilkan daftar resource hub API yang di-pagination, dengan metadata khusus resource.
Untuk mengetahui informasi selengkapnya tentang penelusuran teks bebas dengan API hub API, lihat dokumentasi referensi API untuk
Method:project.locations.searchResources.
Opsi penelusuran berbasis filter
Anda dapat menyaring daftar API yang ditampilkan di halaman API menggunakan atribut sistem sebagai parameter penelusuran.
Sesuaikan
daftar resource API yang ditampilkan menggunakan salah satu hal berikut:
Dengan penelusuran daftar berbasis filter, Anda dapat menyederhanakan daftar API berdasarkan sejumlah parameter standar dan
atribut sistem yang terkait dengan resource. Anda dapat menggunakan opsi Match ALL atau Match ANY untuk menyesuaikan tampilan yang difilter.
Untuk menentukan opsi filter:
Di konsol Google Cloud, buka halaman APIs di API Hub.
Klik kolom Filter table untuk memfilter tabel. Panel Filter akan terbuka.
Tentukan atau pilih opsi filter. Saat Anda mengetik di panel Filter, menu dengan opsi filter akan muncul yang menyertakan
daftar atribut sistem yang
relevan dengan konteks saat ini. Misalnya, berikut adalah atribut sistem yang mungkin Anda lihat saat memfilter API di halaman API:
Nama API: Nama tampilan API
Unit bisnis: Unit bisnis yang bertanggung jawab atas API
Tim: Tim produksi yang bertanggung jawab atas API
Dokumentasi: Link singkat ke dokumentasi API.
Anda akan melihat atribut sistem dalam daftar filter di tabel API, Versi, dan
Spesifikasi.
Setelah memilih opsi filter, pilih nilai filter dari daftar Nilai. Atau,
Anda dapat memasukkan nilai untuk atribut filter yang dipilih.
Untuk menambahkan filter tambahan, klik kolom Filter table untuk memilih dari Operators yang tersedia, lalu pilih atribut dan nilai filter lainnya.
Properti filter yang dipilih menampilkan logika bersyarat yang digunakan kueri filter. Anda dapat memilih OR sebagai operator. Jika tidak ada
operator yang dipilih, defaultnya adalah AND.
Untuk menghapus filter satu per satu, klik X pada filter.
Untuk menghapus semua filter, klik Hapus semua di panel Filter.
Penomoran halaman
Jika ada beberapa resource API, resource tersebut dapat ditampilkan di beberapa halaman.
Untuk menyesuaikan tampilan daftar dan berpindah antarhalaman:
Di konsol Google Cloud, buka halaman APIs di API Hub.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-28 UTC."],[[["\u003cp\u003eThis page outlines how to use Semantic Search, powered by Vertex AI, and filter-based options to efficiently search for resources within Apigee and Apigee hybrid's API hub.\u003c/p\u003e\n"],["\u003cp\u003eSemantic Search enables free-text queries to find APIs, versions, specifications, operations, and deployments based on semantically similar terms found in the API resource entries.\u003c/p\u003e\n"],["\u003cp\u003eUsers can search using system or user attributes and refine search results by filtering and clicking on categories in the results, such as APIs, Versions, Specifications, Operations, and Deployments.\u003c/p\u003e\n"],["\u003cp\u003eYou can also use an API call to search resources, where you can specify a query and filter the results by resource type.\u003c/p\u003e\n"],["\u003cp\u003eFilter options allow you to narrow the displayed APIs based on attributes like API name, business unit, team, and documentation, with the ability to use \u003ccode\u003eMatch ALL\u003c/code\u003e or \u003ccode\u003eMatch ANY\u003c/code\u003e criteria.\u003c/p\u003e\n"]]],[],null,["# Search for and filter APIs\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\nThis topic describes how to use Semantic Search powered by [Vertex AI](/vertex-ai/docs) and filter-based search options to search\nfor specific resources in API hub.\n**Figure 1.** API hub provides powerful natural language search and filter features.\n\nSearch API hub using Semantic Search\n------------------------------------\n\nYou can easily find and view API resources registered in your API hub using Semantic Search. Semantic Search allows\nyou to search all available API resources in your instance using a *free-text search query*. You can search across all entity types (APIs, API operations, specifications, and more.),\nor specify the entity type that you want to query.\n\nWith its Vertex AI search engine, Semantic Search can go beyond term \"matching.\" Semantic Search returns results\ncontaining terms found anywhere in the detailed API resource entries that are semantically similar to the free text search queries entered.\n\nFree-text search returns the following categories of results:\n\n- **APIs** : A list of APIs that match the search. For each API, the following details are provided:\n - The name of the API with a link to the API details page.\n - A brief description of the resource.\n - The name and email address of the resource owner.\n- **Versions** : A list of API versions that match the search. For each version, the following details are provided:\n - The names of the APIs associated with the version, with a link that takes you to the API details page.\n - The name of the API version, with a link that takes you to the version details page.\n - The description of the version and related metadata.\n- **Specifications** : A list of API specifications that match the search. For each specification, the following details are provided:\n - The names of the API associated with the specification, with a link that takes you to the API details page.\n - The name of the API specification, with a link that takes you to the version details page associated with the specification.\n - The description of the specification.\n - A link to the specification document.\n - The type of specification, such as OpenAPI spec.\n- **Operations** : A list of API operations that match the search. For each operation, the following details are provided:\n - The names of the API associated with the operation, with a link that takes you to the API details page.\n - The name of the operation, with a link that takes you to the version details page associated with the operation.\n - The description of the specification.\n - A link to the specification document that defines the operation.\n - A link to the version that includes the operation.\n- **Deployments** : A list of deployments that match the search. For each deployment, the following details are provided:\n - The name of the deployment.\n - The description of the deployment.\n - The deployment type. For example, Apigee hybrid.\n - A link to the version that includes the deployment.\n\n\u003cbr /\u003e\n\nTo search for APIs containing a specific term:\n\n1. In the Google Cloud console, go to the API hub **Semantic search** page.\n\n [Go to API hub](https://console.cloud.google.com//apigee/api-hub/search)\n2. Type a search query in the search box.\n\n For example, you could enter \"Order management APIs\" or \"Spec file for wireless carrier settings\".\n\n You can refine your search by using [system attributes](/apigee/docs/apihub/manage-attributes#system-attributes) within your search query prompt. If you created\n [user attributes](/apigee/docs/apihub/manage-attributes#user-attributes) when registering your APIs in API hub, you can also incorporate these attributes in your search query prompts.\n3. The **Search results** are categorized under the following tabs: APIs, Versions, Specifications, Operations, and Deployments. Click one of the tabs to see results for a category. The results display API resources that contain terms semantically similar to the search query you entered.\n4. Click the API resource name to view the detail page for the resource.\n5. To clear the current query, click **Clear results**.\n\nSearch API hub using the API\n----------------------------\n\nYou can also search your API hub resources using the API hub API. The `searchResources` method\nallows you to query your API hub resources using free text queries and filters.\n\nYou can use the following API call to search across your API hub resources: \n\n```carbon\ncurl -X POST https://apihub.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e:searchResources \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" -H \"Content-Type: application/json\" \\\n -d '{\n \"query\":\"\u003cvar translate=\"no\"\u003eQUERY\u003c/var\u003e\",\n \"filter\":\"resource_type = \u003cvar translate=\"no\"\u003eRESOURCE_TYPE\u003c/var\u003e\"\n }'\n```\n\nWhere:\n\n- **PROJECT_ID** is the ID of the host project for your API hub instance.\n- **LOCATION** is the location where your API hub instance is hosted.\n- **QUERY** is the free text query to be used in the search. The query can contain keywords related to any detail of the API hub resource, including display names, descriptions, or other metadata..\n- **RESOURCE_TYPE** is the optional filter specified for your search. You can specify one of the following API hub resource types as a filter:\n - `Api`\n - `ApiOperation`\n - `Deployment`\n - `Definition`\n - `Spec`\n - `Version`\n\n\u003cbr /\u003e\n\nFor example: \n\n```carbon\ncurl -X POST https://apihub.googleapis.com/v1/projects/{project-id}/locations/{location}:searchResources \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" -H \"Content-Type: application/json\" \\\n -d '{\n \"query\":\"dog status in the store\",\n \"filter\":\"resource_type = SPEC\"\n }'\n```\n\nThis call returns a paginated list of API hub resources, with resource-specific metadata.\n\nFor more information on free-text search with the API hub API, see the API reference documentation for\n[`Method:project.locations.searchResources`](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/searchResources).\n\nFilter-based search options\n---------------------------\n\n\u003cbr /\u003e\n\nYou can refine the list of APIs displayed on the **APIs** page by using system attributes as search parameters.\nCustomize\nthe list of API resources displayed using one of the following:\n\n- [Filter](#filter)\n- [Pagination](#pagination)\n\n### Filter\n\nUsing the filter-based list search, you can streamline your APIs list based on a number of predefined parameters and\nsystem attributes associated with the resource. You can use the `Match ALL` or `Match ANY` options\nto customize your filtered view.\n| **Note:** The filter options available are configured by a user with [administrator permissions](/apigee/docs/apihub/iam-roles). For more information, see [Manage API hub settings](/apigee/docs/apihub/settings-overview) and [Manage attributes](/apigee/docs/apihub/manage-attributes).\n\n\nTo specify filter options:\n\n1. In the Google Cloud console, go to the API hub **APIs** page.\n\n [Go to API hub APIs](https://console.cloud.google.com//apigee/api-hub/apis)\n2. Click in the **Filter table** field to filter the table. The **Filter** pane opens. **Tip:**You can show or hide columns in the APIs table. Use the action menu in the Filter row to select and unselect row names.\n3. Specify or select filter options. When you type in the Filter pane, a menu with filter options pops up that includes a list of [system attributes](/apigee/docs/apihub/manage-attributes#system-attributes) that are relevant to the current context. For example, these are system attributes that you may see when filtering the APIs in the **APIs** page:\n - **API name**: The display name of the API\n - **Business unit:** The business unit responsible for an API\n - **Team:** The producing team responsible for an API\n - **Documentation**: A short link to the API documentation.\n | **Note:** There may be additional attributes listed as filter options. For more information, see [Manage API attributes](/apigee/docs/apihub/manage-attributes).\n - You'll see system attributes in the filter list in the **APIs** , **Versions** , and **Specifications** tables.\n4. After selecting a filter option, select a filter value from the **Values** list. Alternatively, you can enter a value for the filter attribute you select.\n5. To add an additional filter, click in the **Filter table** field to select from the available **Operators** and then select another filter attribute and value.\n6. The selected filter properties display the conditional\n logic that the filter query is using. You can select `OR` as an operator. If no\n operator is selected, the default is `AND`.\n\n7. To clear an individual filter, click the **X** on the filter. To clear all filters, click **Clear all** in the **Filter** pane.\n\n### Pagination\n\nWhen there are multiple API resources, they may be displayed across multiple pages.\n\nTo customize the list display and navigate between pages:\n\n1. In the Google Cloud console, go to the API hub **APIs** page.\n\n [Go to API hub APIs](https://console.cloud.google.com//apigee/api-hub/apis)\n\n The **APIs** list page is displayed by default.\n2. From the **APIs** list, locate the pagination tools\n as shown in Figure 2:\n\n **Figure 2.** Move back and forth through paginated results.\n3. Select the number of APIs to display per page.\n4. Click **\\\u003e Forward**to go to the next page.\n5. Click**\\\u003c Back**to go to the previous page.\n\nWhat's next?\n------------\n\n- Learn how to [Manage deployments](/apigee/docs/apihub/manage-api-deployments)."]]