Get started with custom search

Vertex AI Search brings together the power of deep informationretrieval, state-of-the-art natural language processing, and the latest in largelanguage processing to understand user intent and return the most relevantresults for the user.

With Vertex AI Search, you can create apps for searching and formaking recommendations. Vertex AI Search also has specialcapabilities for some industries, such as media, healthcare, and retail.

This tutorial focuses on creating a search app forcustom data; thatis, data which isn't specific to an industry vertical.

This tutorial explains how to create search apps for different kinds of data:

  • Website data from crawlingcloud.google.com/generative-ai-app-builder/
  • Structured data in the form of an NDJSON-formatted dataset ingested from aCloud Storage bucket
  • Unstructured data in the form of PDFs ingested from a Cloud Storage bucket

Before following this tutorial, make sure you have done the steps inBefore youbegin.


To follow step-by-step guidance for this task directly in the Google Cloud console, clickGuide me:

Guide me


Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI Search (Discovery Engine), BigQuery, Cloud Storage APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enable permission.Learn how to grant roles.

    Enable the APIs

  5. Make sure that you have the following role or roles on the project: Discovery Engine Admin

    Check for the roles

    1. In the Google Cloud console, go to theIAM page.

      Go to IAM
    2. Select the project.
    3. In thePrincipal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check theRole column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to theIAM page.

      Go to IAM
    2. Select the project.
    3. ClickGrant access.
    4. In theNew principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. ClickSelect a role, then search for the role.
    6. To grant additional roles, clickAdd another role and add each additional role.
    7. ClickSave.
  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  7. Verify that billing is enabled for your Google Cloud project.

  8. Enable the Vertex AI Search (Discovery Engine), BigQuery, Cloud Storage APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enable permission.Learn how to grant roles.

    Enable the APIs

  9. Make sure that you have the following role or roles on the project: Discovery Engine Admin

    Check for the roles

    1. In the Google Cloud console, go to theIAM page.

      Go to IAM
    2. Select the project.
    3. In thePrincipal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check theRole column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to theIAM page.

      Go to IAM
    2. Select the project.
    3. ClickGrant access.
    4. In theNew principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. ClickSelect a role, then search for the role.
    6. To grant additional roles, clickAdd another role and add each additional role.
    7. ClickSave.

Enable Vertex AI Search

  1. In the Google Cloud console, go to theAI Applications page.

    AI Applications

  2. Optional: ClickAllow Google to selectively sample model input andresponses.

  3. ClickContinue and activate the API.

Create a data store

First, you'll create a data store which contains the data that your search app will index.

Click the tab for the type of data that you want to put in your data store: website, structured, or unstructured.

Website data

  1. Go to theCreate data store page.

    AI Applications - Create data store

  2. In theSelect a data source pane, selectWebsite content.

  3. In theSpecify the websites for your data store pane, make sure thatAdvanced website indexing is turned off.

  4. In theSites to include field, enter:

    cloud.google.com/generative-ai-app-builder/*
  5. ClickContinue.

  6. In theConfigure your data store pane, selectglobal (Global) as the location for your data store.

  7. Enter a name for your data store. Note theID that is generated. You'll need this later.

  8. ClickCreate.

Structured data

  1. Go to theCreate data store page.

    AI Applications - Create data store

  2. In theSelect a data source pane, selectCloud Storage.

  3. In theImport data from Cloud Storage pane, selectStructured data (JSONL).

  4. Make sureFile is selected.

  5. In thegs:// field, enter the following value:

    cloud-samples-data/gen-app-builder/search/kaggle_movies/movie_metadata.ndjson

    This Cloud Storage bucket contains an NDJSON-formatted file of moviesmade available byKaggle.

  6. ClickContinue.

  7. Assign key properties as follows:

    Field nameKey property
    homepageuri
    overviewdescription

    And, clickContinue.

  8. In theConfigure your data store pane, selectglobal (Global) as the location for your data store.

  9. Enter a name for your data store. Note theID that is generated. You'll need this later.

  10. ClickCreate.

Unstructured data

  1. Go to theCreate data store page.

    AI Applications - Create data store

  2. In theSelect a data source pane, selectCloud Storage.

  3. In theImport data from Cloud Storage pane, selectUnstructured documents (PDF, HTML, TXT and more).

  4. Make sureFolder is selected.

  5. In thegs:// field, enter the following value:

    cloud-samples-data/gen-app-builder/search/alphabet-investor-pdfs

    This Cloud Storage bucket contains earnings report PDFs from theAlphabet investor site.

  6. ClickContinue.

  7. In theConfigure your data store pane, selectglobal (Global) as the location for your data store.

  8. Enter a name for your data store. Note theID that is generated. You'll need this later.

  9. ClickCreate.

Create a search app

Next, you'll create a search app and link the data store you created previously.

Website data

  1. Go to theCreate App page.

    AI Applications - Create App

  2. UnderSite search with AI mode, clickCreate.

  3. Make sure thatEnterprise edition features is turned on.

  4. In theYour app namefield, enter a name for your app. Your app ID appears under the app name.

  5. In theExternal name of your company or organization field, enter thecompany or organization name. For this tutorial, you can useGoogleCloud, because the app will search a Google Cloud website.

  6. Selectglobal (Global) as the location for your app, and then clickContinue.

  7. In the list of data stores, select the data store that you created earlier, and then clickCreate.

  8. Go to your app'sData page to view the list of indexed websites and change them if needed.

Structured data

  1. Go to theCreate App page.

    AI Applications - Create App

  2. UnderSite search with AI mode, clickCreate.

  3. Make sure thatEnterprise edition features is turned on.

  4. In theYour app namefield, enter a name for your app. Your app ID appears under the app name.

  5. In theExternal name of your company or organization field, enter thecompany or organization name. For this tutorial, you can useCymbal Cinemas, because the app will search a data store of movies.

  6. Selectglobal (Global) as the location for your app, and then clickContinue.

  7. In the list of data stores, select the data store that you created earlier, and then clickCreate.

  8. On your app'sData page, click theActivity tab to see thestatus of your data ingestion.Import completed displays in theStatus column when the import process is complete. For this dataset,this typically takes two to three minutes. You might need to clickRefresh to seeImport completed.

  9. Click theDocuments tab to see the number of documents imported.

Unstructured data

  1. Go to theCreate App page.

    AI Applications - Create App

  2. UnderSite search with AI mode, clickCreate.

  3. Make sure thatEnterprise features is turned on.

  4. In theYour app namefield, enter a name for your app. Your app ID appears under the app name.

  5. In theExternal name of your company or organization field, enter thecompany or organization name. For this tutorial, you can useAlphabet, because the app will search over Alphabet documents.

  6. Selectglobal (Global) as the location for your app, and then clickContinue.

  7. In the list of data stores, select the data store that you created earlier, and then clickCreate.

  8. On your app'sData page, click theActivity tab to see thestatus of your data ingestion. When the import process is complete,theStatus column displaysImport completed. For this dataset,the import process typically takes two to three minutes. You might need to clickRefresh to see theImport completed status.

  9. Click theDocuments tab to see the number of documents imported.

Preview your app

Website data

  1. On theApps page, click the name of your new app.

  2. In the navigation menu, clickPreviewto test the search app.

  3. Optional: Click the view icons to switch between mobile view and desktop view.

  4. In the search bar, perform a search forVertex AI Search to view results about the product.

Structured data

  1. On theApps page, click the name of your new app.

  2. In the navigation menu, clickPreviewto test the search app.

  3. Optional: Click the view icons to switch between mobile view and desktop view.

  4. In the search bar, entertrains, and then pressEnter to getresults for movies related to trains.

Unstructured data

  1. On theApps page, click the name of your new app.

  2. In the navigation menu, clickPreviewto test the search app.

  3. Optional: Click the view icons to switch between mobile view and desktop view.

  4. In the search bar, enterGoogle, and then pressEnter to view your results.

Configure the search widget

  1. In the navigation menu, clickConfigurations.

  2. On theUI tab, configure settings for the search app.

    Different UI configurations are available for different data types. For more information, seeConfigure results for the search widget.

  3. If you change configurations on theUI tab, clickSave and publish.

  4. Go to theAutocomplete tab to configure specific settings for autocomplete.

    For more information, seeConfigure autocomplete.

  5. Go to theResponse Settings tab to configure advanced features.

    For more information, seeAbout advanced features.

Deploy a search app

  1. On theApps page, click the name of the app that you want to deploy.

  2. In the navigation menu, clickIntegration.

  3. Make sure theWidget tab is selected.

  4. SelectJWT or OAuth based as the widget authorization type.

  5. In theDomain field, enter the domain name for web page where you'llput the widget. For example, if you are going to copy the widget to the webpageexample.com/ai.html, enterexample.com as the domain.

  6. ClickAdd, and then clickSave.

  7. Copy the code snippet provided in theCopy the following code to your web application section.

  8. In your codebase, generate an authorization token.

  9. To pass the authorization token to your widget, use the "Setauthorization token" code snippet provided in theCopy the following codeto your web application section and replace the text<JWT or OAuth token provided by your backend> with your authorization token.

  10. Test your deployed app. You can further adjust the configuration by following the steps "Configure the search widget". Make sure to clickSave and publish so that the changes take effect on the deployed widget.

Clean up

To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.

  1. To avoid unnecessary Google Cloud charges, use theGoogle Cloud console to delete your project if you don't need it.
  2. If you created a new project to learn about Vertex AI Search and youno longer need the project,delete the project.
  3. If you used an existing Google Cloud project, delete the resources youcreated to avoid incurring charges to your account. For more information,seeDelete an app.
  4. Follow the steps inTurn offVertex AI Search.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.