[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["Improve job search results using ML and Talent Solution\n=======================================================\n\nThis page shows you how to improve search results by using Cloud Talent Solution,\nmachine learning (ML), and client event data.\n\n[Cloud Talent Solution](/talent-solution/job-search/v3) is a service that brings machine learning to your job search experience, returning high quality results to job seekers far beyond the limitations of typical keyword-based methods. Right out of the box, CTS applies relevance models and job/skill\nontologies to your job details. You can improve the results returned to job seekers by recording client events\nbased on the activity of the job seeker.\n\nThere are two methods for leveraging this feature, both outlined in this quickstart. We recommend that you use the `createClientEventRequest`\nAPI method, which bypasses the authentication challenges of sending messages to Cloud Talent Solution\nusing [Cloud Pub/Sub](/pubsub/docs) and provides a clean set of APIs\nto implement the [analytics framework](/talent-solution/job-search/v3/docs/improve-job-search-results-ml).\n\nYou'll begin publishing client event data by the end of the tutorial.\n\nRecord client events using `createClientEventRequest` (recommended)\n-------------------------------------------------------------------\n\nWhen a job seeker performs a specific\naction, you can use the API to record that action. For example, the job seeker\nor other entity interacting with the service has had a job\n(or a list of jobs) rendered in their view, such as in a list of search results\nin a compressed or clipped format. In this case you can send an IMPRESSION event\nto Cloud Talent Solution to provide the context of the search results and what a\njob seeker can see. Further, when the job seeker clicks on a job result to view\nthe full job description, you can send a VIEW event to register the interest of\nthis job seeker in this position.\n\n### Usage\n\nThe following example illustrates how to send a message to Cloud Talent Solution\nusing the API. The job seeker or other entity interacting with the service\nhas had a job (or a list of jobs) rendered in their view, such as in a list of\nsearch results in a compressed or clipped format. This event is typically\nassociated with the viewing of a jobs list on a single page by a job seeker.\n\nPlease visit [Event Types](/talent-solution/job-search/v3/docs/client-event#EventType)\nfor a full listing of available event types.\n\nRecord client event requests using Cloud Pub/Sub\n------------------------------------------------\n\n### Requirements\n\nIn order to publish pubsub messages it is required that you publish messages **ONLY** to the\nproject `p-jobs` and the topic `cloud-jobs-events`.\n\n*Any pubsub message that does not contain a requestId is dropped.*\n\nBefore you begin\n----------------\n\nYou have:\n\n- set up a [Cloud Talent Solution project](/talent-solution/job-search/v3/docs/before-you-begin) in the Google Cloud Platform Console,\n- [created companies and jobs](/talent-solution/job-search/v3/docs/create-company-job) and have successfully [searched](/talent-solution/job-search/v3/docs/quickstart-searching) for your jobs,\n- installed the [Cloud Pub/Sub client library](/pubsub/docs/reference/libraries),\n\n- set up your environment using\n [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials),\n\n- enabled the [Google Cloud Pub/Sub API](https://console.cloud.google.com/apis/library/pubsub.googleapis.com)\n on your Google Cloud Project,\n\n- basic familiarity with Java programming.\n\n| **Note:** Critical in the above list is setting the environment variable [`GOOGLE_APPLICATION_CREDENTIALS`](/talent-solution/job-search/v3/docs/libraries#setting_up_authentication) to the path of the credentials file created when setting up the service account. See the [Cloud Pub/Sub](/pubsub/docs/publisher#publish-messages-to-a-topic) documentation for more information on how to publish data to a project and topic.\n\nThis tutorial covers the integration instructions to create a publisher client,\npublish client events through Cloud Pub/Sub, and clean up. We demonstrate\nthe integration by stepping through a Cloud Talent Solution application using Java code,\nthat focuses on explaining how to make calls to Cloud Talent Solution, rather than\nexplaining the Java client libraries.\n\n### Publish client event data to Cloud Talent Solution\n\nThis section walks you through publishing client event data to\nCloud Talent Solution, which can be used to improve relevance for your specific\nbusiness and job seeker needs.\n\nFollow the Google Cloud Pub/Sub [Publisher Guide](/pubsub/docs/publisher#publish-messages-to-a-topic)\nto publish messages to Cloud Talent Solution.\n| **Note:** The project-id (`p-jobs`) and topic-id (`cloud-jobs-events`) are automatically created for you to publish messages to. Ensure that all messages are only published to this project and topic. You don't have permission to list topics, or perform any action apart from publishing to this project and topic.\n\nCheck that the actual messages sent follow the pattern as described below.\n\n### Sample messages\n\n#### IMPRESSION event\n\n### JSON\n\n```text\n {\n \"eventId\": \"857523730h91wrgkih9qpl12z8bf\",\n \"eventType\": \"IMPRESSION\",\n \"requestId\": \"8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==\",\n \"relatedJobNames\": [\n \"jobs/4000000000\",\n \"jobs/4000000001\"\n ],\n \"eventTimestampMillis\": 1518200614309,\n }\n \n```\n\n\u003cbr /\u003e\n\n#### VIEW event\n\n### JSON\n\n```text\n {\n \"eventId\": \"9q9wa69qgfx1q1xzwn3zo25z\",\n \"eventType\": \"VIEW\",\n \"requestId\": \"248pla4w-8wpl-87rt-15rt-430ue8u541m8\",\n \"relatedJobNames\": [\n \"jobs/8000000000\",\n \"jobs/8000000001\"\n ],\n \"eventTimestampMillis\": 1518200617426,\n }\n \n```\n\n\u003cbr /\u003e\n\n### Verify implementation using the Cloud Talent Solution management tools\n\nCloud Talent Solution provides users of the API with tools to verify your\nimplementation by providing you with [self service tools](https://console.cloud.google.com/job-discovery/overview).\n\nTo learn more about the self service tools, see [Cloud Talent Solution management tools](/talent-solution/docs/management-tools).\n\nWhat's next\n-----------\n\n[Improve pre-trained model with client event data](/talent-solution/job-search/v3/docs/events)."]]