השלמה אוטומטית (גרסה 3)

‫Cloud Talent Solution מספק הצעות להשלמה אוטומטית של תיאורי משרה ושמות חברות. רק משרות פתוחות פעילות וחברות עם משרה פתוחה אחת לפחות נחשבות כמתאימות לתוצאות ההצעה. אחרי שמוסיפים משרה או חברה חדשות, יכולות לחלוף עד 48 שעות עד שהמידע יתווסף לתוצאות ההשלמה האוטומטית.

כדי להשתמש בהשלמה אוטומטית, קוראים לשיטה complete כשסרגל החיפוש מתעדכן.

Java

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר בנושא ספריות לקוח של Cloud Talent Solution.


/** Auto completes job titles within given companyName. */
public static void jobTitleAutoComplete(String companyName, String query) throws IOException {

  Complete complete =
      talentSolutionClient
          .projects()
          .complete(DEFAULT_PROJECT_ID)
          .setQuery(query)
          .setLanguageCode("en-US")
          .setType("JOB_TITLE")
          .setPageSize(10);
  if (companyName != null) {
    complete.setCompanyName(companyName);
  }

  CompleteQueryResponse results = complete.execute();

  System.out.println(results);
}

Python

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר בנושא ספריות לקוח של Cloud Talent Solution.

def job_title_auto_complete(client_service, query, company_name):
    complete = client_service.projects().complete(
        name=name, query=query, languageCode="en-US", type="JOB_TITLE", pageSize=10
    )
    if company_name is not None:
        complete.companyName = company_name

    results = complete.execute()
    print(results)

Node.js

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר בנושא ספריות לקוח של Cloud Talent Solution.


const talent = require('@google-cloud/talent').v4;

/**
 * Complete job title given partial text (autocomplete)
 *
 * @param projectId {string} Your Google Cloud Project ID
 * @param tenantId {string} Identifier of the TenantId
 */
function sampleCompleteQuery(
  projectId,
  tenantId,
  query,
  numResults,
  languageCode
) {
  const client = new talent.CompletionClient();
  // const projectId = 'Your Google Cloud Project ID';
  // const tenantId = 'Your Tenant ID (using tenancy is optional)';
  // const query = '[partially typed job title]';
  // const numResults = 5;
  // const languageCode = 'en-US';
  const formattedParent = client.tenantPath(projectId, tenantId);
  const languageCodes = [languageCode];
  const request = {
    parent: formattedParent,
    query: query,
    pageSize: numResults,
    languageCodes: languageCodes,
  };
  client
    .completeQuery(request)
    .then(responses => {
      const response = responses[0];
      for (const result of response.completionResults) {
        console.log(`Suggested title: ${result.suggestion}`);
        // Suggestion type is JOB_TITLE or COMPANY_TITLE
        console.log(`Suggestion type: ${result.type}`);
      }
    })
    .catch(err => {
      console.error(err);
    });
}