Zum Aktivieren der Suche nach öffentlich verfügbaren Inhalten in Ihrem Portal können Sie eine spezielle Suchseite erstellen, in die Sie eine benutzerdefinierte Suchmaschine von Google (Custom Search Engine, CSE) einbinden. Das in der folgenden Abbildung dargestellte Portal bindet eine Google-CSE ein, die die Suche des in Google indexierten Contents ermöglicht.
So erstellen Sie eine benutzerdefinierte Suchseite:
Erstellen Sie eine benutzerdefinierte Google-Engine:
a. Rufen Sie die Konfigurationsseite der benutzerdefinierten Suche von Google auf.
b. Klicken Sie auf Hinzufügen, um eine neue benutzerdefinierte Suchmaschine zu erstellen.
c. Konfigurieren Sie Ihre benutzerdefinierte Suchmaschine und identifizieren Sie die Domain der Portal-Website. Weitere Informationen finden Sie unter Suchmaschine erstellen in der Hilfe zur benutzerdefinierten Suche von Google.
d. Beschleunigen Sie die Website-Indizierung, indem Sie Ihre Website mithilfe der Google Search Console prüfen und einreichen. Weitere Informationen finden Sie unter Website in der Search Console bestätigen in der Hilfe zur benutzerdefinierten Suche von Google.
Erstellen Sie eine neue Suchseite in Ihrem Portal und passen Sie sie nach Bedarf an. Siehe Seiten im Portal verwalten.
Fügen Sie die ID des benutzerdefinierten Suchelements (search-box) in Ihrem benutzerdefinierten Skript an der Stelle ein, an der das Google-Suchfeld angezeigt werden soll.
Beispiel:
<div id="search-box"></div>
Fügen Sie die Suchseite zu Ihrer Portalnavigation nach Bedarf hinzu. Weitere Informationen finden Sie unter Navigation einrichten.
Veröffentlichen Sie die Suchseite und die Navigationsupdates.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThis content pertains to setting up a search function within Apigee and Apigee hybrid portals using Google Custom Search Engine (CSE).\u003c/p\u003e\n"],["\u003cp\u003eGoogle CSE can only return results for content that is publicly accessible, without requiring user sign-in, and ads cannot be disabled unless you're an approved non-profit.\u003c/p\u003e\n"],["\u003cp\u003eCreating a custom search page involves publishing portal content, setting up the search engine through Google's configuration page, adding a custom script to your portal, and integrating the search box into your portal pages.\u003c/p\u003e\n"],["\u003cp\u003eImplementing a Google Custom Search Engine requires setting the \u003ccode\u003ecx\u003c/code\u003e variable to your Google search engine ID, and the \u003ccode\u003epath\u003c/code\u003e value to your search page URL in the provided script.\u003c/p\u003e\n"],["\u003cp\u003eAfter publication, it may take several days or even up to a month before Google fully indexes your site's content, so it is advised to test over time and potentially delay publishing the search page.\u003c/p\u003e\n"]]],[],null,["# Creating a custom search page\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n\u003cbr /\u003e\n\nTo enable search of the publicly available content in your portal, you can create a dedicated search page where you embed a [Google Custom Search Engine (CSE)](https://cse.google.com).\n\n| Before embedding a Google custom search engine, note the following:\n|\n| - Search using a Google CSE can return only results for **publicly available content**. In other words, a portal user must not be required to sign in to the portal to view the content.\n| - At this time, you cannot disable ads in search results unless you are an approved non-profit site.\n| - Google CSE is not included with an Apigee license. (An out-of-the-box search solution in the integrated portal is planned for a future release.)\n| - The [Google Search Console](https://search.google.com/search-console/about) (also not included with an Apigee license) is another tool you may use to remove or manage your portal's presence in Google's search index.\n\nTo create a custom search page:\n\n1. [Publish your portal content](/apigee/docs/api-platform/publish/portal/portal-publish).\n2. Create a Google custom search engine:\n\n 1. Navigate to the [Google custom search](https://cse.google.com/cse) configuration page.\n 2. Click **Add** to create a new custom search engine.\n 3. Configure your custom search engine and identify the portal site domain. See [Create a search engine](https://support.google.com/programmable-search/answer/11082370?ref_topic=4513742) in the Google Custom Search Help. The custom search configuration returns something like the following: \n\n ```text\n \u003cscript async src=\"https://cse.google.com/cse.js?cx=e13bcb52d46f04dfd\"\u003e\u003c/script\u003e\n \u003cdiv class=\"gcse-search\"\u003e\u003c/div\u003e\n ```\n Where `cx=e13bcb52d46f04dfd` is the Google search engine ID.\n\n | **Tip:** You can expedite site indexing by verifying and submitting your site using Google Search Console. See [Verify your site in Search console](https://support.google.com/customsearch/answer/2402989?ref_topic=4513742%22%20class=%22external) in the Google Search Console Help.\n3. Add the following custom script to your portal. See [Adding custom scripts](/apigee/docs/api-platform/publish/portal/custom-scripts).\n\n Set the `cx` variable to your Google search engine ID, for example\n `e13bcb52d46f04dfd`, and the `path` value to your search page URL,\n for example, `/search`. \n\n \u003cscript\u003e\n window.portal = {\n pageEventListeners: {\n onLoad: (path) =\u003e {\n // Update with your search page URL\n if (path === '/your-search-page-URL') {\n // Add your Google search engine ID\n var cx = 'your-search-engine-id';\n var gcse = document.createElement('script');\n gcse.type = 'text/javascript';\n gcse.async = true;\n gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(gcse, s);\n gcse.onload = function () {\n var search = document.createElement('gcse:search');\n // Note the element ID name\n var searchBox = document.getElementById('search-box');\n searchBox.appendChild(search);\n };\n }\n }\n }\n };\n \u003c/script\u003e\n\n4. Create a new search page in your portal and customize it as described in\n [Manage pages in your portal](/apigee/docs/api-platform/publish/portal/portal-pages).\n\n5. Add the custom search element ID (`search-box`) defined in your custom\n script at the location that you want the Google search box to appear.\n For example\n `\u003cdiv id=\"search-box\"\u003e\u003c/div\u003e`\n\n6. Add the search page to your portal navigation, as described in\n [Set up navigation](/apigee/docs/api-platform/publish/portal/portal-menus).\n\n7. Publish your search page and navigation updates.\n\n| It takes time for Google to index your site so you may not see search results right away. (It can take a couple of days up to a month to complete full indexing.) You may want to delay publishing the search page until you have tested your portal site search (over time) and are satisfied with the results being returned."]]