Atribut khusus (v3)

Cloud Talent Solution menyediakan beberapa atribut lowongan yang siap pakai untuk mendukung kebutuhan berbagai pelanggan. Untuk mendapatkan performa terbaik dari Cloud Talent Solution, sebaiknya gunakan kolom siap pakai sebanyak mungkin.

Selain itu, Cloud Talent Solution juga menyediakan atribut kustom untuk menyimpan informasi umum. Atribut kustom digunakan untuk memberikan fleksibilitas yang lebih besar agar pelanggan dapat mendukung logika bisnis mereka. Atribut kustom menyimpan string atau informasi numerik, dan dapat difilter dalam kueri penelusuran dengan menetapkan filter yang sesuai.

Fitur atribut khusus

  • Menentukan nama kolom kustom Anda sendiri: Tentukan nama untuk atribut tertentu dari suatu tugas. Tetapkan atribut ini agar dapat difilter atau tidak dapat difilter, bergantung pada kebutuhan. Biasanya, jika UI memerlukan facet yang dapat difilter yang tidak disediakan secara langsung oleh Cloud Talent Solution, customAttribute dapat digunakan untuk memberikan pemfilteran yang tepat.
  • Penelusuran peka/tidak peka huruf besar/kecil: Setiap permintaan penelusuran dapat menentukan apakah penelusuran terhadap semua atribut kustom peka huruf besar/kecil atau tidak peka huruf besar/kecil.
  • Pemfilteran berbasis rentang: Filter penelusuran customAttribute dapat memfilter tugas antara rentang nilai numerik yang ditentukan. Misalnya, jika kolom customAttribute tertentu digunakan untuk menyimpan persyaratan IPK minimum pekerjaan, filter penelusuran customAttribute dapat digunakan untuk menampilkan pekerjaan dalam rentang IPK minimum tertentu, lebih besar dari nilai IPK minimum, lebih kecil dari nilai IPK minimum, dll.
  • Pemfilteran lintas kolom: customAttribute juga memberi pelanggan Cloud Talent Solution kemampuan untuk menentukan ekspresi yang memfilter kombinasi atribut kustom. Misalnya, pelanggan memiliki logika bisnis yang menyatakan bahwa mereka hanya menginginkan pekerjaan yang mensponsori visa, atau pekerjaan jarak jauh. Pelanggan menyimpan kedua kolom ini di customAttribute yang berbeda. Kemudian, pelanggan dapat menentukan filter penelusuran dengan ekspresi yang menentukan logika yang diperlukan. Hanya 3 tingkat ekspresi bertingkat yang didukung.

  • Penelusuran khusus kata kunci: Tentukan customAttribute tertentu di keywordSearchableCustomAttributes perusahaan terkait untuk memastikan permintaan penelusuran yang berisi nilai di customAttribute yang ditentukan menampilkan tugas yang berisi nilai ini di customAttribute tersebut.

  • Penelusuran berbasis SQL: customAttribute memungkinkan Anda menentukan ekspresi gaya boolean dalam permintaan penelusuran. Cloud Talent Solution secara otomatis mengurai ekspresi ini, menerapkan filter ke permintaan penelusuran, dan menampilkan hasil sesuai kebutuhan. Hanya 3 tingkat penyusunan bertingkat dari ekspresi boolean dan maksimal 2.000 karakter yang diizinkan.

  • Menentukan bucket histogram kustom: Atribut kustom memungkinkan pelanggan Cloud Talent Solution menetapkan bucket kustom yang dapat digunakan untuk menghitung histogram. Misalnya, Anda dapat menggunakan customAttribute untuk menyimpan informasi IPK minimum, lalu membuat histogram di kolom ini. Anda dapat membuat bucket lebih lanjut dari 3,0 - 3,5, 3,51 - 4,0, dll., untuk mengelompokkan semua IPK minimum dalam bucket ini.

Menggunakan atribut khusus

Buat tugas baru dengan kolom customAttribute (dapat digunakan dengan nilai numerik atau string):

Java

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.


/** Generate a job with a custom attribute. */
@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
public static Job generateJobWithACustomAttribute(String companyName) {
  // requisition id should be a unique Id in your system.
  String requisitionId = "jobWithACustomAttribute:" + String.valueOf(new Random().nextLong());
  ApplicationInfo applicationInfo =
      new ApplicationInfo().setUris(Arrays.asList("http://careers.google.com"));

  // Constructs custom attributes map
  Map<String, CustomAttribute> customAttributes = new HashMap<>();
  customAttributes.put(
      "someFieldName1",
      new CustomAttribute().setStringValues(Arrays.asList("value1")).setFilterable(Boolean.TRUE));
  customAttributes.put(
      "someFieldName2",
      new CustomAttribute().setLongValues(Arrays.asList(256L)).setFilterable(true));

  // Creates job with custom attributes
  Job job =
      new Job()
          .setCompanyName(companyName)
          .setRequisitionId(requisitionId)
          .setTitle("Software Engineer")
          .setApplicationInfo(applicationInfo)
          .setDescription("Design, develop, test, deploy, maintain and improve software.")
          .setCustomAttributes(customAttributes);
  System.out.println("Job generated: " + job);
  return job;
}

Python

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.

def generate_job_with_custom_attributes(company_name):
    # Requisition id should be a unique Id in your system.
    requisition_id = "job_with_custom_attributes:" + "".join(
        random.choice(string.ascii_uppercase + string.digits) for _ in range(16)
    )

    job_title = "Software Engineer"
    application_urls = ["http://careers.google.com"]
    description = "Design, develop, test, deploy, maintain and improve " "software."

    custom_attributes = {
        "someFieldName1": {"string_values": ["value1"], "filterable": True},
        "someFieldName2": {"long_values": [256], "filterable": True},
    }

    job = {
        "company_name": company_name,
        "requisition_id": requisition_id,
        "title": job_title,
        "application_info": {"uris": application_urls},
        "description": description,
        "custom_attributes": custom_attributes,
    }
    print("Job generated: %s" % job)
    return job

Go

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.


// constructJobWithCustomAttributes constructs a job with custom attributes.
func constructJobWithCustomAttributes(companyName string, jobTitle string) *talent.Job {
	// requisitionID shoud be the unique ID in your system
	requisitionID := fmt.Sprintf("job-with-custom-attribute-%d", time.Now().UnixNano())

	job := &talent.Job{
		RequisitionId: requisitionID,
		Title:         jobTitle,
		CompanyName:   companyName,
		ApplicationInfo: &talent.ApplicationInfo{
			Uris: []string{"https://googlesample.com/career"},
		},
		Description: "Design, devolop, test, deploy, maintain and improve software.",
		CustomAttributes: map[string]talent.CustomAttribute{
			"someFieldString": {
				Filterable:   true,
				StringValues: []string{"someStrVal"},
			},
			"someFieldLong": {
				Filterable: true,
				LongValues: []int64{900},
			},
		},
	}
	return job
}

Buat filter di kolom customAttribute:

Java

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.


/** CustomAttributeFilter on String value CustomAttribute */
public static void filtersOnStringValueCustomAttribute()
    throws IOException, InterruptedException {
  // Make sure to set the requestMetadata the same as the associated search request
  RequestMetadata requestMetadata =
      new RequestMetadata()
          // Make sure to hash your userID
          .setUserId("HashedUserId")
          // Make sure to hash the sessionID
          .setSessionId("HashedSessionID")
          // Domain of the website where the search is conducted
          .setDomain("www.google.com");

  String customAttributeFilter = "NOT EMPTY(someFieldName1)";
  JobQuery jobQuery = new JobQuery().setCustomAttributeFilter(customAttributeFilter);

  SearchJobsRequest searchJobsRequest =
      new SearchJobsRequest()
          .setJobQuery(jobQuery)
          .setRequestMetadata(requestMetadata)
          .setJobView("JOB_VIEW_FULL");
  SearchJobsResponse response =
      talentSolutionClient
          .projects()
          .jobs()
          .search(DEFAULT_PROJECT_ID, searchJobsRequest)
          .execute();
  Thread.sleep(1000);
  System.out.printf("Custom search job results (String value): %s\n", response);
}

Python

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.

def custom_attribute_filter_string_value(client_service):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }

    custom_attribute_filter = "NOT EMPTY(someFieldName1)"
    job_query = {"custom_attribute_filter": custom_attribute_filter}
    request = {
        "request_metadata": request_metadata,
        "job_query": job_query,
        "job_view": "JOB_VIEW_FULL",
    }

    response = (
        client_service.projects().jobs().search(parent=parent, body=request).execute()
    )
    print(response)

Go

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.


// filterOnStringValueCustomAttribute searches for jobs on a string value custom
// atrribute.
func filterOnStringValueCustomAttribute(w io.Writer, projectID string) (*talent.SearchJobsResponse, error) {
	ctx := context.Background()

	client, err := google.DefaultClient(ctx, talent.CloudPlatformScope)
	if err != nil {
		return nil, fmt.Errorf("google.DefaultClient: %w", err)
	}
	// Create the jobs service client.
	service, err := talent.New(client)
	if err != nil {
		return nil, fmt.Errorf("talent.New: %w", err)
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		JobQuery: &talent.JobQuery{
			CustomAttributeFilter: "NOT EMPTY(someFieldString)",
		},
		// Make sure to set the RequestMetadata the same as the associated
		// search request.
		RequestMetadata: &talent.RequestMetadata{
			// Make sure to hash your userID.
			UserId: "HashedUsrId",
			// Make sure to hash the sessionID.
			SessionId: "HashedSessionId",
			// Domain of the website where the search is conducted.
			Domain: "www.googlesample.com",
		},
		JobView: "JOB_VIEW_FULL",
	}
	resp, err := service.Projects.Jobs.Search(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with string value custom attribute: %w", err)
	}

	fmt.Fprintln(w, "Jobs:")
	for _, j := range resp.MatchingJobs {
		fmt.Fprintf(w, "\t%q\n", j.Job.Name)
	}

	return resp, nil
}

Buat filter lain dengan customAttribute:

Java

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.


/** CustomAttributeFilter on Long value CustomAttribute */
public static void filtersOnLongValueCustomAttribute() throws IOException, InterruptedException {
  // Make sure to set the requestMetadata the same as the associated search request
  RequestMetadata requestMetadata =
      new RequestMetadata()
          // Make sure to hash your userID
          .setUserId("HashedUserId")
          // Make sure to hash the sessionID
          .setSessionId("HashedSessionID")
          // Domain of the website where the search is conducted
          .setDomain("www.google.com");

  String customAttributeFilter = "(255 <= someFieldName2) AND (someFieldName2 <= 257)";
  JobQuery jobQuery = new JobQuery().setCustomAttributeFilter(customAttributeFilter);

  SearchJobsRequest searchJobsRequest =
      new SearchJobsRequest()
          .setJobQuery(jobQuery)
          .setJobView("JOB_VIEW_FULL")
          .setRequestMetadata(requestMetadata);

  SearchJobsResponse response =
      talentSolutionClient
          .projects()
          .jobs()
          .search(DEFAULT_PROJECT_ID, searchJobsRequest)
          .execute();
  Thread.sleep(1000);
  System.out.printf("Custom search job results (Long value): %s\n", response);
}

Python

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.

def custom_attribute_filter_long_value(client_service):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }

    custom_attribute_filter = "(255 <= someFieldName2) AND" " (someFieldName2 <= 257)"
    job_query = {"custom_attribute_filter": custom_attribute_filter}
    request = {
        "request_metadata": request_metadata,
        "job_query": job_query,
        "job_view": "JOB_VIEW_FULL",
    }

    response = (
        client_service.projects().jobs().search(parent=parent, body=request).execute()
    )
    print(response)

Go

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.


// filterOnLongValueCustomAttribute searches for jobs on a long value custom
// atrribute.
func filterOnLongValueCustomAttribute(w io.Writer, projectID string) (*talent.SearchJobsResponse, error) {
	ctx := context.Background()

	client, err := google.DefaultClient(ctx, talent.CloudPlatformScope)
	if err != nil {
		return nil, fmt.Errorf("google.DefaultClient: %w", err)
	}
	// Create the jobs service client.
	service, err := talent.New(client)
	if err != nil {
		return nil, fmt.Errorf("talent.New: %w", err)
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		JobQuery: &talent.JobQuery{
			CustomAttributeFilter: "someFieldLong < 1000",
		},
		// Make sure to set the RequestMetadata the same as the associated
		// search request.
		RequestMetadata: &talent.RequestMetadata{
			// Make sure to hash your userID.
			UserId: "HashedUsrId",
			// Make sure to hash the sessionID.
			SessionId: "HashedSessionId",
			// Domain of the website where the search is conducted.
			Domain: "www.googlesample.com",
		},
		JobView: "JOB_VIEW_FULL",
	}
	resp, err := service.Projects.Jobs.Search(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with long value custom attribute: %w", err)
	}

	fmt.Fprintln(w, "Jobs:")
	for _, j := range resp.MatchingJobs {
		fmt.Fprintf(w, "\t%q\n", j.Job.Name)
	}

	return resp, nil
}

Manfaatkan atribut kustom untuk memfasilitasi pemfilteran lintas kolom:

Contoh berikut mengilustrasikan cara menentukan permintaan penelusuran yang menelusuri lowongan dengan target rasio bonus antara 10% dan 20%, atau lowongan yang memerlukan keterampilan "Pengelolaan Tim", ATAU lowongan yang memiliki nilai yang tidak kosong di customAttribute "visa_required".

Java

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.


/** CustomAttributeFilter on multiple CustomAttributes */
public static void filtersOnMultiCustomAttributes() throws IOException, InterruptedException {
  // Make sure to set the requestMetadata the same as the associated search request
  RequestMetadata requestMetadata =
      new RequestMetadata()
          // Make sure to hash your userID
          .setUserId("HashedUserId")
          // Make sure to hash the sessionID
          .setSessionId("HashedSessionID")
          // Domain of the website where the search is conducted
          .setDomain("www.google.com");

  String customAttributeFilter =
      "(someFieldName1 = \"value1\") "
          + "AND ((255 <= someFieldName2) OR (someFieldName2 <= 213))";
  JobQuery jobQuery = new JobQuery().setCustomAttributeFilter(customAttributeFilter);

  SearchJobsRequest searchJobsRequest =
      new SearchJobsRequest()
          .setJobQuery(jobQuery)
          .setRequestMetadata(requestMetadata)
          .setJobView("JOB_VIEW_FULL");
  SearchJobsResponse response =
      talentSolutionClient
          .projects()
          .jobs()
          .search(DEFAULT_PROJECT_ID, searchJobsRequest)
          .execute();
  Thread.sleep(1000);
  System.out.printf("Custom search job results (multiple value): %s\n", response);
}

Python

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.

def custom_attribute_filter_multi_attributes(client_service):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }

    custom_attribute_filter = (
        '(someFieldName1 = "value1") AND ((255 <= someFieldName2) OR '
        "(someFieldName2 <= 213))"
    )
    job_query = {"custom_attribute_filter": custom_attribute_filter}
    request = {
        "request_metadata": request_metadata,
        "job_query": job_query,
        "job_view": "JOB_VIEW_FULL",
    }

    response = (
        client_service.projects().jobs().search(parent=parent, body=request).execute()
    )
    print(response)

Go

Untuk mengetahui informasi lebih lanjut tentang cara menginstal dan membuat klien Cloud Talent Solution, lihat Library Klien Cloud Talent Solution.


// filterOnLongValueCustomAttribute searches for jobs on multiple custom
// atrributes.
func filterOnMultiCustomAttributes(w io.Writer, projectID string) (*talent.SearchJobsResponse, error) {
	ctx := context.Background()

	client, err := google.DefaultClient(ctx, talent.CloudPlatformScope)
	if err != nil {
		return nil, fmt.Errorf("google.DefaultClient: %w", err)
	}
	// Create the jobs service client.
	service, err := talent.New(client)
	if err != nil {
		return nil, fmt.Errorf("talent.New: %w", err)
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		JobQuery: &talent.JobQuery{
			CustomAttributeFilter: "(someFieldString = \"someStrVal\") AND (someFieldLong < 1000)",
		},
		// Make sure to set the RequestMetadata the same as the associated
		// search request.
		RequestMetadata: &talent.RequestMetadata{
			// Make sure to hash your userID.
			UserId: "HashedUsrId",
			// Make sure to hash the sessionID.
			SessionId: "HashedSessionId",
			// Domain of the website where the search is conducted.
			Domain: "www.googlesample.com",
		},
		JobView: "JOB_VIEW_FULL",
	}
	resp, err := service.Projects.Jobs.Search(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with multiple custom attributes: %w", err)
	}

	fmt.Fprintln(w, "Jobs:")
	for _, j := range resp.MatchingJobs {
		fmt.Fprintf(w, "\t%q\n", j.Job.Name)
	}

	return resp, nil
}

Secara default, endpoint searchJobs dan seachJobsForAlert hanya menelusuri kolom siap pakai. Jika Anda juga perlu menelusuri kolom customAttribute, gunakan kolom keywordSearchableJobCustomAttributes untuk menentukan daftar atribut kustom yang akan ditelusuri.

Misalnya, jika perekrut ingin menggunakan customAttribute "customRequisitions" untuk menyimpan ID permintaan lowongan khusus untuk pemberi kerja tertentu, dengan menetapkan keywordSearchableJobCustomAttributes untuk menyertakan kolom ini, penelusuran reguler yang dilakukan oleh perekrut untuk "ABC123" akan menampilkan semua lowongan yang memiliki customAttribute "customRequisitions" dengan nilai "ABC123".