커스텀 속성

Cloud Talent Solution은 다양한 고객의 요구를 충족할 수 있도록 바로 사용할 수 있는 여러 가지 다른 채용정보 속성을 제공합니다. Cloud Talent Solution에서 최상의 성능을 얻으려면 가능한 한 바로 사용할 수 있는 필드를 활용하는 것이 가장 좋습니다.

Cloud Talent Solution은 일반 정보를 저장하는 커스텀 속성도 제공합니다. 커스텀 속성은 고객이 비즈니스 논리를 지원할 수 있도록 더 많은 유연성을 제공하는 데 사용됩니다. 커스텀 속성은 문자열이나 숫자 정보를 저장하며 적합한 필터를 설정하여 검색 쿼리에서 필터링할 수 있습니다.

커스텀 속성 기능

  • 커스텀 필드 이름 정의: 채용정보의 특정 속성에 대한 이름을 정의합니다. 필요에 따라 이 속성을 필터링 가능 또는 필터링 불가능으로 설정합니다. 일반적으로 UI에 필요한 바로 사용할 수 있는 필터링 가능한 속성을 Cloud Talent Solution에서 제공하지 않는 경우 customAttribute를 사용하여 적절한 필터링을 제공할 수 있습니다.
  • 대소문자 구분(구분 안 함) 검색: 각 검색 요청은 모든 커스텀 속성에 대한 검색이 대소문자를 구분하거나 구분하지 않도록 지정할 수 있습니다.
  • 범위 기반 필터링: customAttribute 검색 필터는 지정된 숫자 값 범위 내에서 채용정보를 필터링할 수 있습니다. 예를 들어, 해당 customAttribute 필드를 사용하여 채용정보의 최소 GPA 요구사항을 저장하는 경우 customAttribute 검색 필터를 사용하여 최소 GPA 값을 초과하고 최소 GPA 값 미만인 특정한 최소 GPA 범위 이내의 채용정보를 반환할 수 있습니다.
  • 교차 필드 필터링: customAttribute는 Cloud Talent Solution 고객에게 커스텀 속성 조합을 필터링하는 표현식을 정의할 수 있는 기능도 제공합니다. 예를 들어 고객에게 비자를 지원하는 채용정보 또는 재택 근무 채용정보만을 원하고 있음을 설명하는 비즈니스 논리가 있는 경우, 고객은 두 필드를 다른 customAttribute에 저장합니다. 이렇게 하면 필요한 논리를 정의하는 표현식으로 검색 필터를 지정할 수 있습니다. 3가지 수준의 중첩된 표현식만 지원됩니다.

  • 키워드별 검색: 지정된 customAttribute 값이 포함된 검색 요청이 해당 customAttribute에서 이 값을 포함하는 채용정보를 반환하도록 하려면 관련 회사의 keywordSearchableCustomAttributes에서 특정 customAttribute를 지정합니다.

  • SQL 기반 검색: customAttributecustomAttribute를 사용하면 검색 요청에 부울 스타일 표현식을 정의할 수 있습니다. Cloud Talent Solution은 이러한 표현식을 자동으로 파싱하고 검색 요청에 필터를 적용하며 그에 따른 결과를 반환합니다. 부울 표현식 중첩은 3가지 수준만 지원되며 최대 2,000자까지 허용됩니다.

  • 커스텀 히스토그램 버킷 정의: 커스텀 속성을 사용하면 Cloud Talent Solution 고객은 히스토그램이 계산할 수 있는 커스텀 버킷을 설정할 수 있습니다. 예를 들어 customAttribute를 사용하여 최소 GPA 정보를 저장한 다음 이 필드에 히스토그램을 작성할 수 있습니다. 3.0 - 3.5, 3.51 - 4.0 등에서 버킷을 더 만들어 이 버킷 내의 모든 최소 GPA를 그룹화할 수 있습니다.

커스텀 속성 사용

customAttribute 필드로 새 채용정보 만들기(숫자 또는 문자열 값과 함께 사용 가능)

Go

CTS용 클라이언트 라이브러리를 설치하고 사용하는 방법은 CTS 클라이언트 라이브러리를 참조하세요. 자세한 내용은 CTS Go API 참조 문서를 확인하세요.

CTS에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

import (
	"context"
	"fmt"
	"io"

	talent "cloud.google.com/go/talent/apiv4beta1"
	"cloud.google.com/go/talent/apiv4beta1/talentpb"
	"github.com/gofrs/uuid"
	money "google.golang.org/genproto/googleapis/type/money"
)

// createJobWithCustomAttributes creates a job with custom attributes.
func createJobWithCustomAttributes(w io.Writer, projectID, companyID, jobTitle string) (*talentpb.Job, error) {
	ctx := context.Background()

	// Initialize a job service client.
	c, err := talent.NewJobClient(ctx)
	if err != nil {
		return nil, fmt.Errorf("talent.NewJobClient: %w", err)
	}
	defer c.Close()

	// requisitionID shoud be the unique ID in your system
	requisitionID := fmt.Sprintf("job-with-custom-attribute-%s", uuid.Must(uuid.NewV4()).String())
	jobToCreate := &talentpb.Job{
		Company:       fmt.Sprintf("projects/%s/companies/%s", projectID, companyID),
		RequisitionId: requisitionID,
		Title:         jobTitle,
		ApplicationInfo: &talentpb.Job_ApplicationInfo{
			Uris: []string{"https://googlesample.com/career"},
		},
		Description:     "Design, devolop, test, deploy, maintain and improve software.",
		LanguageCode:    "en-US",
		PromotionValue:  2,
		EmploymentTypes: []talentpb.EmploymentType{talentpb.EmploymentType_FULL_TIME},
		Addresses:       []string{"Mountain View, CA"},
		CustomAttributes: map[string]*talentpb.CustomAttribute{
			"someFieldString": {
				Filterable:   true,
				StringValues: []string{"someStrVal"},
			},
			"someFieldLong": {
				Filterable: true,
				LongValues: []int64{900},
			},
		},
		CompensationInfo: &talentpb.CompensationInfo{
			Entries: []*talentpb.CompensationInfo_CompensationEntry{
				{
					Type: talentpb.CompensationInfo_BASE,
					Unit: talentpb.CompensationInfo_HOURLY,
					CompensationAmount: &talentpb.CompensationInfo_CompensationEntry_Amount{
						Amount: &money.Money{
							CurrencyCode: "USD",
							Units:        1,
						},
					},
				},
			},
		},
	}

	// Construct a createJob request.
	req := &talentpb.CreateJobRequest{
		Parent: fmt.Sprintf("projects/%s", projectID),
		Job:    jobToCreate,
	}

	resp, err := c.CreateJob(ctx, req)
	if err != nil {
		return nil, fmt.Errorf("CreateJob: %w", err)
	}

	fmt.Fprintf(w, "Created job with custom attributres: %q\n", resp.GetName())
	fmt.Fprintf(w, "Custom long field has value: %v\n", resp.GetCustomAttributes()["someFieldLong"].GetLongValues())

	return resp, nil
}

Java

Cloud Talent Solution 클라이언트 설치 및 만들기에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.


import com.google.cloud.talent.v4.CreateJobRequest;
import com.google.cloud.talent.v4.CustomAttribute;
import com.google.cloud.talent.v4.Job;
import com.google.cloud.talent.v4.JobServiceClient;
import com.google.cloud.talent.v4.TenantName;
import java.io.IOException;

public class JobSearchCreateJobCustomAttributes {

  public static void createJob() throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "your-project-id";
    String tenantId = "your-tenant-id";
    String companyId = "your-company-id";
    String requisitionId = "your-unique-req-id";
    createJob(projectId, tenantId, companyId, requisitionId);
  }

  // Create Job with Custom Attributes.
  public static void createJob(
      String projectId, String tenantId, String companyId, String requisitionId)
      throws IOException {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // the "close" method on the client to safely clean up any remaining background resources.
    try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
      TenantName parent = TenantName.of(projectId, tenantId);

      // Custom attribute can be string or numeric value, and can be filtered in search queries.
      // https://cloud.google.com/talent-solution/job-search/docs/custom-attributes
      CustomAttribute customAttribute =
          CustomAttribute.newBuilder()
              .addStringValues("Internship")
              .addStringValues("Apprenticeship")
              .setFilterable(true)
              .build();

      Job job =
          Job.newBuilder()
              .setCompany(companyId)
              .setTitle("Software Developer I")
              .setDescription("This is a description of this <i>wonderful</i> job!")
              .putCustomAttributes("FOR_STUDENTS", customAttribute)
              .setRequisitionId(requisitionId)
              .setLanguageCode("en-US")
              .build();

      CreateJobRequest request =
          CreateJobRequest.newBuilder().setParent(parent.toString()).setJob(job).build();
      Job response = jobServiceClient.createJob(request);
      System.out.printf("Created job: %s\n", response.getName());
    }
  }
}

Node.js

Cloud Talent Solution 클라이언트 설치 및 만들기에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.


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

/**
 * Create Job with Custom Attributes
 *
 * @param projectId {string} Your Google Cloud Project ID
 * @param tenantId {string} Identifier of the Tenantd
 */
function sampleCreateJob(
  projectId,
  tenantId,
  companyName,
  requisitionId,
  languageCode
) {
  const client = new talent.JobServiceClient();
  // const projectId = 'Your Google Cloud Project ID';
  // const tenantId = 'Your Tenant ID (using tenancy is optional)';
  // const companyName = 'Company name, e.g. projects/your-project/companies/company-id';
  // const requisitionId = 'Job requisition ID, aka Posting ID. Unique per job.';
  // const languageCode = 'en-US';
  const formattedParent = client.tenantPath(projectId, tenantId);
  const job = {
    company: companyName,
    requisitionId: requisitionId,
    languageCode: languageCode,
  };
  const request = {
    parent: formattedParent,
    job: job,
  };
  client
    .createJob(request)
    .then(responses => {
      const response = responses[0];
      console.log(`Created job: ${response.name}`);
    })
    .catch(err => {
      console.error(err);
    });
}

Python

Cloud Talent Solution 클라이언트 설치 및 만들기에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.


from google.cloud import talent

def create_job(project_id, tenant_id, company_id, requisition_id):
    """Create Job with Custom Attributes"""

    client = talent.JobServiceClient()

    # project_id = 'Your Google Cloud Project ID'
    # tenant_id = 'Your Tenant ID (using tenancy is optional)'
    # company_id = 'Company name, e.g. projects/your-project/companies/company-id'
    # requisition_id = 'Job requisition ID, aka Posting ID. Unique per job.'
    # language_code = 'en-US'

    if isinstance(project_id, bytes):
        project_id = project_id.decode("utf-8")
    if isinstance(tenant_id, bytes):
        tenant_id = tenant_id.decode("utf-8")
    if isinstance(company_id, bytes):
        company_id = company_id.decode("utf-8")

    # Custom attribute can be string or numeric value,
    # and can be filtered in search queries.
    # https://cloud.google.com/talent-solution/job-search/docs/custom-attributes
    custom_attribute = talent.CustomAttribute()
    custom_attribute.filterable = True
    custom_attribute.string_values.append("Intern")
    custom_attribute.string_values.append("Apprenticeship")

    parent = f"projects/{project_id}/tenants/{tenant_id}"

    job = talent.Job(
        company=company_id,
        title="Software Engineer",
        requisition_id=requisition_id,
        description="This is a description of this job",
        language_code="en-us",
        custom_attributes={"FOR_STUDENTS": custom_attribute},
    )

    response = client.create_job(parent=parent, job=job)
    print(f"Created job: {response.name}")
    return response.name

기본적으로 searchJobssearchJobsForAlert 엔드포인트는 즉시 사용 가능한 필드만 검색합니다. customAttribute 필드도 검색해야 하는 경우 keywordSearchableJobCustomAttributes 필드를 사용하여 검색할 커스텀 속성 목록을 정의합니다.

예를 들어, 채용 담당자가 customAttribute 'customRequisitions'를 사용하여 특정 고용주별 채용정보의 요청 ID를 저장하려는 경우 keywordSearchableJobCustomAttributes를 설정하여 이 필드를 포함하면 채용 담당자가 정기적으로 수행하는 'ABC123' 검색은 customAttribute 'customRequisitions' 값이 'ABC123'인 모든 채용정보를 반환합니다.