建立程式化搜尋引擎
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
建立程式化搜尋引擎的方法有兩種:
要開始使用程式化搜尋引擎,最簡單的方法是透過控制台建立基本的搜尋引擎。接著,您可以下載引擎的 XML 檔案並進行修改,進一步加入自訂項目。由於你正在進行實驗與瞭解一些基本概念,因此只需花幾分鐘就能建立你的第一個搜尋引擎。請保持簡單明瞭,以便在開始測試時追蹤情況。而且日後隨時都可更改。
在控制台中定義程式化搜尋引擎
如何建立程式化搜尋引擎:
- 使用您的 Google 帳戶登入控制台 (如果沒有,請建立帳戶)。
- 在「為搜尋引擎命名」部分中,指定搜尋引擎名稱。您隨時可以變更這個名稱。
- 在「What to search?」(要搜尋什麼?) 部分,新增要納入搜尋引擎的網頁。您可以加入任何網站,而不是只有您擁有的網站。您可以使用整個網站的網址或個別網頁網址。也可以使用網址模式。
- 點選「建立」。
您的基本搜尋引擎已準備就緒!如要查看更多設定選項,請前往「控制台」。
如要進一步瞭解控制台提供的選項,請造訪程式化搜尋引擎說明中心。如要新增進階選項 (例如篩選或搜尋結果順序),並透過 XML 設定檔進一步自訂搜尋引擎,請參閱開發人員指南。
使用引擎
定義搜尋引擎後,您可以透過兩種方法存取搜尋引擎:
- Google 代管的程式化搜尋引擎首頁 - 您可以在「Overview」頁面的「Basic」部分找到引擎首頁的「公開網址」並與使用者分享。
- 在網站上使用搜尋框:如果您在網頁中嵌入搜尋框,使用者就能在您的網站進行搜尋。
下一步...
請繼續前往「導入搜尋框」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eProgrammable Search Engines can be created through a user-friendly Control Panel or by defining them within an XML file.\u003c/p\u003e\n"],["\u003cp\u003eThe Control Panel offers a simple way to build a basic search engine, allowing you to specify the name, website scope, and included pages.\u003c/p\u003e\n"],["\u003cp\u003eAfter creation, your search engine is accessible via a public URL or by embedding a search box directly into your website.\u003c/p\u003e\n"],["\u003cp\u003eFurther customization, such as filtering and result ordering, can be achieved by modifying the engine's XML configuration files.\u003c/p\u003e\n"]]],[],null,["# Creating a Programmable Search Engine\n\nThere are two ways of creating a Programmable Search Engine:\n\n- using the [Control Panel](https://programmablesearchengine.google.com/controlpanel/create)\n- creating an [XML file](/custom-search/docs/basics) with the definition of the engine\n\nThe easiest way to get started with Programmable Search Engine is to create a basic search engine using the [Control Panel](https://programmablesearchengine.google.com/controlpanel/create). You can then download the engine's XML files and modify them to add further customizations.\nSince you're experimenting and figuring out some basic concepts, spend only a couple of minutes making your first search engine. Keep it simple so that you can follow what's happening when you start testing it. You can always change it later.\n\nDefining a Programmable Search Engine in Control Panel\n------------------------------------------------------\n\nTo create a Programmable Search Engine:\n\n1. Sign into [Control Panel](https://programmablesearchengine.google.com/controlpanel/create) using your Google Account ([get an account](https://www.google.com/accounts/NewAccount) if you don't have one).\n2. In the **Name your search engine** section, specify your search engine's name. You can change this name at any time.\n3. In the **What to search?** section, add the pages you want to include in your search engine. You can include any sites you want, not just the sites you own. You can include whole site URLs or individual pages URLs. You can also use [URL patterns](https://support.google.com/programmable-search/answer/12397162).\n4. Click **Create**.\n\nYour basic search engine is ready to use! To see more configuration options, go to the [Control Panel](https://programmablesearchengine.google.com/controlpanel/all).\n\nTo learn more about options available in Control Panel, visit the [Programmable Search Engine Help Center](http://support.google.com/programmable-search/). To add advanced options (e.g. filtering or results order) and further customize your search engine via XML configuration files, see the [Developer Guide](/custom-search/docs/basics#steps).\n\nUsing the engine\n----------------\n\nOnce you have defined your search engine, it can be accessed in two ways:\n\n- Google-hosted Programmable Search Engine homepage - you can find the **Public URL** for your engine homepage in the **Overview** page's **Basic** section and share it with your users.\n- A search box in your website - If you embed a search box in your webpage, your users can make searches from your website.\n\nNext...\n-------\n\nContinue to [Implementing search box](/custom-search/docs/tutorial/implementingsearchbox)."]]