Get started with generic search

Vertex AI Search brings together the power of deep information retrieval, state-of-the-art natural language processing, and the latest in large language processing to understand user intent and return the most relevant results for the user.

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

This tutorial focuses on creating a search app for generic data; that is, data which are not specific to an industry vertical.

This tutorial explains how to create three search apps, each for a different kind of data:

  • Website content from crawling cloud.google.com
  • Structured data in the form of an NDJSON-formatted dataset ingested from a Cloud 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 in Before you begin.


To follow step-by-step guidance for this task directly in the Google Cloud console, click Guide 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.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI Search and Conversation, BigQuery, Cloud Storage APIs.

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Enable the Vertex AI Search and Conversation, BigQuery, Cloud Storage APIs.

    Enable the APIs

Activate Vertex AI Search and Conversation

  1. In the Google Cloud console, go to the Search and Conversation page.

    Search and Conversation

  2. Read and agree to the Terms of Service, then click Continue and activate the API.

Create a search app for website data

  1. In the Google Cloud console, go to the Search and Conversation page.

    Search and Conversation

  2. Click New app.

  3. In the Select app type pane, select Search.

  4. If you are offered a choice of generic or media content, click Generic.

  5. In order to create a website search app, make sure Enterprise features is turned on.

  6. If you don't plan to use Advanced LLM features for this app, turn off the Advanced LLM features option.

  7. In the Your app name field, enter a name for your app. Your app ID appears under the app name.

  8. In the External name of your company or organization field, enter the company or organization name.

  9. Select global (Global) as the location for your app, and then click Continue.

  10. In the Data stores pane, click Create new data store.

  11. In the Select a data source pane, select Website URLs.

  12. Make sure that Advanced website indexing is turned off.

  13. In the Specify the websites for your data store pane, in the Sites to include field, enter cloud.google.com/* and then click Continue.

  14. In the Configure your data store pane, enter a name for your data store, and then click Create.

  15. On the Data stores page, select your new data store, and then click Create.

Preview your app for website data

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

  2. On the Preview page, perform a search for Document AI to view results about the product.

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

  4. Click Analytics to go to the analytics page.

    It can take up 12 hours after you set up search for analytics to be available for viewing.

Create and preview a search app for structured data from Cloud Storage

  1. In the Google Cloud console, go to the Search and Conversation page.

    Search and Conversation

  2. Click New app.

  3. In the Select app type pane, select Search.

  4. If you are offered a choice of generic or media content, click Generic.

  5. If you don't plan to use Enterprise edition features for this app, turn off the Enterprise edition features option to avoid incurring additional costs.

  6. If you don't plan to use Advanced LLM features for this app, turn off the Advanced LLM features option.

  7. In the App name field, enter a name for your app. Your app ID appears under the app name.

  8. Select global (Global) as the location for your app, and then click Continue.

  9. In the Data stores pane, click Create new data store.

  10. In the Select a data source pane, select Cloud Storage.

  11. In the Import data from GCS pane, make sure Folder is selected.

  12. In the gs:// field, enter the following value:

    cloud-samples-data/gen-app-builder/search/kaggle_movies
    

    This Cloud Storage bucket contains an NDJSON-formatted dataset of movies made available by Kaggle.

  13. Select JSON for structured data, and then click Continue.

  14. In the Configure your data store pane, select global (Global) as the location for your data store.

  15. Enter a name for your data store, and then click Create.

  16. On the Data stores page, select your new data store and click Create.

  17. On your data store's Data page, click the Activity tab to see the status of your data ingestion. Import completed displays in the Status column when the import process is complete. For this dataset, this typically takes two to three minutes. You might need to click Refresh to see Import completed.

  18. Click the Documents tab to see the number of documents imported.

  19. In the navigation menu, click Preview to test the search app.

  20. In the search bar, enter Harry Potter, and then press Enter to get results about the Harry Potter series of movies.

Create and preview a search app for unstructured data from Cloud Storage

  1. In the Google Cloud console, go to the Search and Conversation page.

    Search and Conversation

  2. Click New app.

  3. In the Select app type pane, select Search.

  4. If you are offered a choice of generic or media content, click Generic.

  5. If you don't plan to use Enterprise edition features for this app, turn off the Enterprise edition features option to avoid incurring additional costs.

  6. If you don't plan to use Advanced LLM features for this app, turn off the Advanced LLM features option.

  7. In the App name field, enter a name for your app. Your app ID appears under the app name.

  8. Select global (Global) as the location for your app, and then click Continue.

  9. In the Data stores pane, click Create new data store.

  10. In the Select a data source pane, select Cloud Storage.

  11. In the Import data from GCS pane, make sure Folder is selected.

  12. 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 the Alphabet investor site.

  13. Select Unstructured documents, and then click Continue.

  14. In the Configure your data store pane, select global (Global) as the location for your data store.

  15. Enter a name for your data store, and then click Create.

  16. In the Data stores pane, select your new data store and click Create.

  17. On your data store's Data page, click the Activity tab to see the status of your data ingestion. Import completed displays in the Status column when the import process is complete.

  18. Click the Documents tab to see the number of documents imported.

  19. In the navigation menu, click Preview to test the search app.

  20. In the search bar, enter Google, and then press Enter to view your results.

Deploy a search app

  1. In the Google Cloud console, go to the Search and Conversation page.

    Search and Conversation

  2. Click the name of the app that you want to deploy.

  3. In the navigation menu, click Integration.

  4. Make sure the Widget tab is selected.

  5. Select JWT or OAuth based as the widget authorization type.

  6. In the Domain field, enter the domain name for web page where you will put the widget. For example, if you are going to copy the widget to the web page example.com/ai.html, enter example.com as the domain.

  7. Click Add, and then click Save.

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

  9. In your codebase, generate an authorization token.

  10. To pass the authorization token to your widget, use the "Set authorization token" code snippet provided in the Copy the following code to your web application section and replace the text <JWT or OAuth token provided by you backend> with your authorization token.

  11. In the navigation menu, click Configurations to configure settings for the search app.

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 the Google Cloud console to delete your project if you do not need it.
  2. If you created a new project to learn about Vertex AI Search and Conversation and you no longer need the project, delete the project.
  3. If you used an existing Google Cloud project, delete the resources you created to avoid incurring charges to your account. For more information, see Delete an app.
  4. Follow the steps in Turn off Vertex AI Search and Conversation.

What's next