Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Mit Vertex AI Search können Sie mit einer Anwendung mit Websitedaten nach Bildern suchen. Sie stellen eine Anfrage in Form eines Textstrings oder eines Bildes bereit und die Methode default_config.search gibt Bilder für diese Anfrage zurück.
Hinweise
Prüfen Sie, ob die folgenden Voraussetzungen erfüllt sind. Die Anforderungen variieren je nachdem, ob Sie mit einer Text- oder Bildanfrage suchen.
Wenn Sie in Ihrer Suchanwendung für Websites mit einer Textanfrage suchen, muss Folgendes aktiviert sein: Funktionen der Enterprise-Version
Wenn Sie in Ihrer Suchanwendung für Websites mit einer Bildanfrage suchen, müssen die folgenden Optionen aktiviert sein:
Wenn Sie die Befehlszeile verwenden möchten, um eine Vorschau der Bildergebnisse für eine Website zu sehen, verwenden Sie die Methode engines.servingConfigs.search:
Suchen Sie Ihre App-ID. Wenn Sie Ihre App-ID bereits haben, fahren Sie mit dem nächsten Schritt fort.
Rufen Sie in der Google Cloud Console die Seite KI-Anwendungen auf.
Suchen Sie auf der Seite Apps nach dem Namen Ihrer App und entnehmen Sie die App-ID der Spalte ID.
Rufen Sie die Methode engines.servingConfigs.search auf und geben Sie 1 für search_type an. Wählen Sie die Methodensyntax je nachdem aus, ob Ihre Anfrage Text oder Bild-Bytes enthält.
[[["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-08 (UTC)."],[[["\u003cp\u003eVertex AI Search enables searching for images within website data using either a text string or an image as the query input.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize image search, Enterprise edition features and advanced website indexing must be enabled within your app's settings.\u003c/p\u003e\n"],["\u003cp\u003eImage search functionality is initiated using the \u003ccode\u003eengines.servingConfigs.search\u003c/code\u003e method via command line, which is preferred over the datastore search method, and specifying \u003ccode\u003e1\u003c/code\u003e for the \u003ccode\u003esearch_type\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWhen using the command line, you will need to use your project ID and app ID, as well as a text query or base64-encoded image bytes.\u003c/p\u003e\n"],["\u003cp\u003eThe search results provide detailed information about the matching images, including the title of the webpage containing the image, the image URL, the context link, size, and dimensions.\u003c/p\u003e\n"]]],[],null,["# Search for images on websites\n\nWith Vertex AI Search, you can search for images using a app with\nwebsite data. You supply a query in the form of a text string or an image, and\nthe `default_config.search` method returns images for that query.\n| **Note:** Image search is not available using the Google Cloud console.\n\nBefore you begin\n----------------\n\nMake sure you satisfy the following prerequisites. Requirements vary depending\non whether you search using a text query or an image query.\n\n- If you search using a text query in your website search app, make sure the\n following is turned on: [Enterprise edition features](/generative-ai-app-builder/docs/about-advanced-features#enterprise-features)\n\n- If you search using an image query in your website search app, make sure the\n following are turned on:\n\n - [Enterprise edition features](/generative-ai-app-builder/docs/about-advanced-features#enterprise-features)\n\n - [Advanced website indexing](/generative-ai-app-builder/docs/about-advanced-features#advanced-website-indexing)\n\nPreview image search\n--------------------\n\nTo use the command line to preview image results for a website,\nuse the [`engines.servingConfigs.search`](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines.servingConfigs/search) method:\n| **Note:** You can search over an app using the [`engines.servingConfigs.search`](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines.servingConfigs/search) method and you can search over a data store using the [`dataStores.servingConfigs.search`](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.dataStores.servingConfigs/search) method. For the following procedure, Google recommends searching using the `engines.servingConfigs.search` method.\n\n1. Find your app ID. If you already have your app ID, skip to the next step.\n\n 1. In the Google Cloud console, go to the **AI Applications** page.\n\n [Go to Apps](https://console.cloud.google.com/gen-app-builder/engines)\n 2. On the **Apps** page, find the name of your app and get the app's ID from\n the **ID** column.\n\n2. Call the\n [`engines.servingConfigs.search`](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines.servingConfigs/search)\n method, specifying `1` for the `search_type`. Choose the method syntax\n depending on whether your query is\n text or image bytes.\n\n **Key Term:** In Vertex AI Search, the term *app* can be used interchangeably with the term *engine* in the context of APIs. \n\n ### Query is a text string\n\n curl -X POST \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json\" \\\n -H \"X-Goog-User-Project: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\" \\\n \"https://discoveryengine.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/global/collections/default_collection/engines/\u003cvar translate=\"no\"\u003eAPP_ID\u003c/var\u003e/servingConfigs/default_config:search\" \\\n -d '{\n \"servingConfig\": \"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/global/collections/default_collection/engines/\u003cvar translate=\"no\"\u003eAPP_ID\u003c/var\u003e/servingConfigs/default_search\",\n \"query\": \"\u003cvar translate=\"no\"\u003eQUERY\u003c/var\u003e\",\n \"pageSize\": \"\u003cvar translate=\"no\"\u003ePAGE_SIZE\u003c/var\u003e\",\n \"offset\": \"\u003cvar translate=\"no\"\u003eOFFSET\u003c/var\u003e\",\n \"params\": {\"search_type\": 1}\n }'\n\n ### Query is an image\n\n curl -X POST \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json\" \\\n -H \"X-Goog-User-Project: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\" \\\n \"https://discoveryengine.googleapis.com/v1beta/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/global/collections/default_collection/engines/\u003cvar translate=\"no\"\u003eAPP_ID\u003c/var\u003e/servingConfigs/default_search:search\" \\\n -d '{\n \"servingConfig\": \"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/global/collections/default_collection/engines/\u003cvar translate=\"no\"\u003eAPP_ID\u003c/var\u003e/servingConfigs/default_search\",\n \"imageQuery\": {\"imageBytes\":\"\u003cvar translate=\"no\"\u003eIMAGE_BYTES\u003c/var\u003e\"},\n \"pageSize\": \"\u003cvar translate=\"no\"\u003ePAGE_SIZE\u003c/var\u003e\",\n \"offset\": \"\u003cvar translate=\"no\"\u003eOFFSET\u003c/var\u003e\",\n \"params\": {\"search_type\": 1}\n }'\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your project.\n\n - \u003cvar translate=\"no\"\u003eAPP_ID\u003c/var\u003e: the ID of your app.\n\n - \u003cvar translate=\"no\"\u003eQUERY\u003c/var\u003e: the search query text. For example, \"Round headlight\n cars\" or \"show me dress with stripes.\"\n\n - \u003cvar translate=\"no\"\u003eIMAGE_BYTES\u003c/var\u003e: the image in Base64 encoded bytes. Supported\n formats are JPEG, PNG, and BMP.\n\n - \u003cvar translate=\"no\"\u003ePAGE_SIZE\u003c/var\u003e: optional. The number of results returned by the\n search. The default value is 10 for website search.\n\n - Values below 0 cause an error.\n - Values above 100 cause the value to be set to 100.\n - \u003cvar translate=\"no\"\u003eOFFSET\u003c/var\u003e: optional. The starting index of the results.\n The default value is 0.\n\n For example, if the offset is 2 and the page size is 10, results 2\n through 11 are returned.\n3. Review the response. See the following table for field descriptions:"]]