Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Hướng dẫn này cho thấy cách triển khai một giải pháp Cloud Search đơn giản và sử dụng GitHub làm kho lưu trữ dữ liệu cần lập chỉ mục. Cụ thể, hướng dẫn này bao gồm 2 ứng dụng mẫu:
Một trình kết nối nội dung, được tạo bằng Cloud Search Connector SDK, dùng để lập chỉ mục dữ liệu có trong kho lưu trữ GitHub. Dữ liệu được lập chỉ mục bao gồm các vấn đề, yêu cầu kéo và nội dung đầu của nhánh mặc định (master).
Một ứng dụng web sử dụng tiện ích tìm kiếm để cung cấp giao diện tìm kiếm tuỳ chỉnh.
Điều kiện tiên quyết
Hướng dẫn này yêu cầu bạn phải đáp ứng các điều kiện tiên quyết sau:
Quản trị viên có quyền truy cập vào một miền Google Workspace hoặc Cloud Identity có bật tính năng Lập chỉ mục dữ liệu của bên thứ ba trong Cloud Search. Nếu không xem được các chế độ cài đặt trong Bảng điều khiển dành cho quản trị viên, hãy liên hệ với quản trị viên miền hoặc đăng ký Cloud Search.
Để bắt đầu, bạn phải tạo một dự án trên Google Cloud Platform. Dự án này là cơ sở để tạo, bật và sử dụng tất cả các dịch vụ của Google Cloud Platform (GCP), bao gồm cả việc quản lý API, bật tính năng thanh toán, thêm và xoá cộng tác viên, cũng như quản lý quyền.
Ở đầu trang, hãy nhấp vào arrow_drop_down ở bên phải "Google Cloud Console". Một hộp thoại liệt kê các dự án hiện tại sẽ xuất hiện.
Nhấp vào DỰ ÁN MỚI. Màn hình Dự án mới sẽ xuất hiện.
Trong trường Project Name (Tên dự án), hãy nhập tên dự án, chẳng hạn như "SearchTutorial".
(không bắt buộc) Nhấp vào Chỉnh sửa để chỉnh sửa mã dự án. Bạn không thể thay đổi mã dự án sau khi tạo dự án, vì vậy, hãy chọn một mã dự án đáp ứng nhu cầu của bạn trong suốt thời gian tồn tại của dự án.
Để duyệt xem các vị trí cho dự án, hãy nhấp vào DUYỆT XEM.
Nhấp vào một vị trí cho dự án của bạn rồi nhấp vào Chọn.
Nhấp vào TẠO. Bảng điều khiển sẽ chuyển đến trang Trang tổng quan. Dự án sẽ được tạo trong vòng vài phút.
Để biết thêm thông tin về cách tạo và quản lý dự án, hãy tham khảo bài viết Tạo và quản lý dự án.
Bật API
Bạn cần bật API Google Cloud Search và tạo một tài khoản dịch vụ để lấy thông tin xác thực.
Trong trình đơn điều hướng bên trái, hãy nhấp vào API và dịch vụ.
Để đảm bảo bạn đang ở dự án mới tạo, hãy nhấp vào biểu tượng arrow_drop_down ở bên phải biểu ngữ Google Cloud Console rồi chọn dự án bạn vừa tạo.
Nhấp vào BẬT API VÀ DỊCH VỤ. Trang "Chào mừng bạn đến với Thư viện API" sẽ xuất hiện.
Nhập "Cloud Search API" vào trường tìm kiếm rồi nhấn phím return. Một danh sách các API sẽ được trả về.
Nhấp vào Cloud Search API. Trang "Cloud Search API" sẽ xuất hiện.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-04 UTC."],[],[],null,["This tutorial shows how to deploy a simple Cloud Search solution and uses\nGitHub as the repository of data to be indexed. Specifically, this\ntutorial consists of two sample applications:\n\n- A content connector, created with the [Cloud Search Connector SDK](/workspace/cloud-search/docs/reference/sdk), used to index data found in GitHub repositories. Data indexed includes issues, pull requests, and the head content of the default branch (`master`).\n- A web app that uses the [search widget](/workspace/cloud-search/docs/guides/search-widget) to provide a customized search interface.\n\n| **Note:** The tutorial content connector is not intended to be used in production and is provided for sample purposes only. For production use, consider creating a [GitHub App](https://developer.github.com/apps/building-your-first-github-app/) to handle indexing.\n\nPrerequisites\n\nThis tutorial requires the following prerequisites:\n\n- Administrator access to a Google Workspace or Cloud Identity domain with Cloud Search for Third Party Data Indexing enabled. If you're unable to view settings in the Admin control panel, either contact your domain administrator or [sign-up for Cloud Search](https://cloud.google.com/products/search/).\n- A [GitHub](https://github.com/) user account.\n- Java and JavaScript familarity.\n- [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) or newer.\n- [Maven](http://maven.apache.org/install.html).\n- [Node.js](https://nodejs.org/) 8.11 or newer.\n\nCreate the tutorial project\n\nTo start, you must create an Google Cloud Platform project. This\nproject forms the basis for creating, enabling, and using all Google Cloud\nPlatform (GCP) services, including managing APIs, enabling billing, adding and\nremoving collaborators, and managing permissions.\n\n1. Open the [Google Cloud console](https://console.cloud.google.com/).\n\n2. At the top of the page, click\n arrow_drop_down\n to the right of \"Google Cloud Console.\" A dialog listing current projects\n appears.\n\n3. Click **NEW PROJECT**. The New Project screen appears.\n\n4. In the **Project Name** field, enter a project name, such as\n \"SearchTutorial.\"\n\n5. (optional) Click **Edit** to edit the Project ID. The project ID can't be\n changed after the project is created, so choose an\n ID that meets your needs for the lifetime of the project.\n\n6. To browse locations for the project, click **BROWSE**.\n\n7. Click on a location for your project and click **Select**.\n\n8. Click **CREATE**. The console navigates to the Dashboard page. The project\n is created within a few minutes.\n\nFor further information on creating and managing projects, refer to\n[Creating and Managing Projects](https://support.google.com/cloud#topic=6158848).\n\nEnable the API\n\nYou need to enable the Google Cloud Search API and create a service account to\nobtain credentials.\n\n1. In the left navigation, click **APIs \\& Services**.\n2. To ensure you are on the newly created project, click the arrow_drop_down icon to the right of the Google Cloud console banner and select your newly-created project.\n3. Click **ENABLE APIS AND SERVICES**. The \"Welcome to API Library\" page appears.\n4. Type \"Cloud Search API\" in the search field and press **return**. A list of APIs is returned.\n5. CLick **Cloud Search API**. The \"Cloud Search API\" page appears.\n6. Click **ENABLE**. The Overview page appears.\n\nFor further information on enabling and disabling APIs, refer to\n[Manage APIs in the Google Cloud console](https://support.google.com/cloud/answer/6326510)\n| **Note:** Different Google Cloud Search APIs require different accounts to execute (admin, service, and user). For further information, refer to the [reference documentation](/workspace/cloud-search/docs/reference) for the method you want to call.\n\nClone the tutorial repository\n\nTo clone the sample repository, run the following command: \n\n git clone https://github.com/googleworkspace/cloud-search-samples.git\n\n[Next](/workspace/cloud-search/docs/tutorials/end-to-end/setup-connector)"]]