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 crawling
cloud.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:
Before you begin
- 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.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
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.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.createpermission.Learn how to grant roles.
Verify that billing is enabled for your Google Cloud project.
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.enablepermission.Learn how to grant roles.Make sure that you have the following role or roles on the project: Discovery Engine Admin
Check for the roles
In the Google Cloud console, go to theIAM page.
Go to IAM- Select the project.
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.
- 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
In the Google Cloud console, go to theIAM page.
Go to IAM- Select the project.
- ClickGrant access.
In theNew principals field, enter your user identifier. This is typically the email address for a Google Account.
- ClickSelect a role, then search for the role.
- To grant additional roles, clickAdd another role and add each additional role.
- ClickSave.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
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.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.createpermission.Learn how to grant roles.
Verify that billing is enabled for your Google Cloud project.
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.enablepermission.Learn how to grant roles.Make sure that you have the following role or roles on the project: Discovery Engine Admin
Check for the roles
In the Google Cloud console, go to theIAM page.
Go to IAM- Select the project.
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.
- 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
In the Google Cloud console, go to theIAM page.
Go to IAM- Select the project.
- ClickGrant access.
In theNew principals field, enter your user identifier. This is typically the email address for a Google Account.
- ClickSelect a role, then search for the role.
- To grant additional roles, clickAdd another role and add each additional role.
- ClickSave.
Enable Vertex AI Search
In the Google Cloud console, go to theAI Applications page.
Optional: ClickAllow Google to selectively sample model input andresponses.
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
Go to the
Create data store page.In theSelect a data source pane, selectWebsite content.
In theSpecify the websites for your data store pane, make sure thatAdvanced website indexing is turned off.
In theSites to include field, enter:
cloud.google.com/generative-ai-app-builder/*
ClickContinue.
In theConfigure your data store pane, selectglobal (Global) as the location for your data store.
Enter a name for your data store. Note the
ID that is generated. You'll need this later.ClickCreate.
Structured data
Go to the
Create data store page.In theSelect a data source pane, selectCloud Storage.
In theImport data from Cloud Storage pane, selectStructured data (JSONL).
Make sureFile is selected.
In the
gs://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.
ClickContinue.
Assign key properties as follows:
Field name Key property homepageurioverviewdescriptionAnd, clickContinue.
In theConfigure your data store pane, selectglobal (Global) as the location for your data store.
Enter a name for your data store. Note the
ID that is generated. You'll need this later.ClickCreate.
Unstructured data
Go to the
Create data store page.In theSelect a data source pane, selectCloud Storage.
In theImport data from Cloud Storage pane, selectUnstructured documents (PDF, HTML, TXT and more).
Make sureFolder is selected.
In the
gs://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.
ClickContinue.
In theConfigure your data store pane, selectglobal (Global) as the location for your data store.
Enter a name for your data store. Note the
ID that is generated. You'll need this later.ClickCreate.
Create a search app
Next, you'll create a search app and link the data store you created previously.
Website data
Go to the
Create App page.UnderSite search with AI mode, clickCreate.
Make sure thatEnterprise edition features is turned on.
In the
Your app name field, enter a name for your app. Your app ID appears under the app name.In theExternal name of your company or organization field, enter thecompany or organization name. For this tutorial, you can use
GoogleCloud, because the app will search a Google Cloud website.Selectglobal (Global) as the location for your app, and then clickContinue.
In the list of data stores, select the data store that you created earlier, and then clickCreate.
Go to your app'sData page to view the list of indexed websites and change them if needed.
Structured data
Go to the
Create App page.UnderSite search with AI mode, clickCreate.
Make sure thatEnterprise edition features is turned on.
In the
Your app name field, enter a name for your app. Your app ID appears under the app name.In theExternal name of your company or organization field, enter thecompany or organization name. For this tutorial, you can use
Cymbal Cinemas, because the app will search a data store of movies.Selectglobal (Global) as the location for your app, and then clickContinue.
In the list of data stores, select the data store that you created earlier, and then clickCreate.
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.
Click theDocuments tab to see the number of documents imported.
Unstructured data
Go to the
Create App page.UnderSite search with AI mode, clickCreate.
Make sure thatEnterprise features is turned on.
In the
Your app name field, enter a name for your app. Your app ID appears under the app name.In theExternal name of your company or organization field, enter thecompany or organization name. For this tutorial, you can use
Alphabet, because the app will search over Alphabet documents.Selectglobal (Global) as the location for your app, and then clickContinue.
In the list of data stores, select the data store that you created earlier, and then clickCreate.
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.
Click theDocuments tab to see the number of documents imported.
Preview your app
Website data
On theApps page, click the name of your new app.
In the navigation menu, click
Preview to test the search app.Optional: Click the view icons to switch between mobile view and desktop view.
In the search bar, perform a search for
Vertex AI Searchto view results about the product.
Structured data
On theApps page, click the name of your new app.
In the navigation menu, click
Preview to test the search app.Optional: Click the view icons to switch between mobile view and desktop view.
In the search bar, enter
trains, and then pressEnter to getresults for movies related to trains.
Unstructured data
On theApps page, click the name of your new app.
In the navigation menu, click
Preview to test the search app.Optional: Click the view icons to switch between mobile view and desktop view.
In the search bar, enter
Google, and then pressEnter to view your results.
Configure the search widget
In the navigation menu, clickConfigurations.
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.
If you change configurations on theUI tab, clickSave and publish.
Go to theAutocomplete tab to configure specific settings for autocomplete.
For more information, seeConfigure autocomplete.
Go to theResponse Settings tab to configure advanced features.
For more information, seeAbout advanced features.
Deploy a search app
On theApps page, click the name of the app that you want to deploy.
In the navigation menu, clickIntegration.
Make sure theWidget tab is selected.
SelectJWT or OAuth based as the widget authorization type.
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 webpage
example.com/ai.html, enterexample.comas the domain.ClickAdd, and then clickSave.
Copy the code snippet provided in theCopy the following code to your web application section.
In your codebase, generate an authorization token.
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.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.
- To avoid unnecessary Google Cloud charges, use theGoogle Cloud console to delete your project if you don't need it.
- If you created a new project to learn about Vertex AI Search and youno longer need the project,delete the project.
- 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.
- 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.