מאפיינים מותאמים אישית

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

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

תכונות של מאפיינים מותאמים אישית

  • הגדרת שם לשדה מותאם אישית: מגדירים שם למאפיין מסוים של משרה. אתם יכולים להגדיר את המאפיין הזה כמאפיין שאפשר לסנן או כמאפיין שלא ניתן לסנן, בהתאם לצרכים שלכם. בדרך כלל, אם ממשק המשתמש צריך היבט שניתן לסינון ושלא מסופק מחוץ לקופסה על ידי Cloud Talent Solution, אפשר להשתמש ב-customAttribute כדי לספק את הסינון הנכון.
  • חיפוש תלוי אותיות רישיות או לא תלוי אותיות רישיות: כל בקשת חיפוש יכולה לציין אם החיפוש בכל המאפיינים המותאמים אישית תלוי אותיות רישיות או לא תלוי אותיות רישיות.
  • סינון לפי טווח: מסנני החיפוש של customAttribute יכולים לסנן משרות לפי טווח של ערכים מספריים שצוינו. לדוגמה, אם משתמשים בשדה customAttribute מסוים כדי לאחסן את דרישות הציון הממוצע המינימלי של משרה, אפשר להשתמש במסנן החיפוש customAttribute כדי להחזיר משרות בטווח מסוים של ציון ממוצע מינימלי, מעל ערך מסוים של ציון ממוצע מינימלי, מתחת לערך מסוים של ציון ממוצע מינימלי וכו'.
  • סינון בין שדות: customAttribute מאפשר גם ללקוחות של Cloud Talent Solution להגדיר ביטויים שמסננים שילוב של מאפיינים מותאמים אישית. לדוגמה, ללקוח יש לוגיקה עסקית שלפיה הוא רוצה רק משרות שכוללות סיוע בהוצאת ויזה או משרות שמאפשרות עבודה מרחוק. הלקוח מאחסן את שני השדות האלה בcustomAttribute אחר. לאחר מכן הלקוח יכול לציין מסנן חיפוש עם ביטוי שמגדיר את הלוגיקה הנדרשת. יש תמיכה רק ב-3 רמות של ביטויים מוטמעים.

  • חיפוש ספציפי למילת מפתח: מציינים customAttribute מסוים ב-keywordSearchableCustomAttributes של החברה המשויכת כדי להבטיח שבקשות חיפוש שמכילות ערך ב-customAttribute שצוין יחזירו את המשרות שמכילות את הערך הזה ב-customAttribute הזה.

  • חיפושים מבוססי SQL: customAttribute מאפשר להגדיר ביטויי בוליאני בסגנון בבקשת החיפוש. ‫Cloud Talent Solution מנתח באופן אוטומטי את הביטויים האלה, מחיל את המסננים על בקשת החיפוש ומחזיר את התוצאות בהתאם. מותר להשתמש רק ב-3 רמות של קינון של ביטויים בוליאניים, ועד 2,000 תווים.

  • הגדרת משבצות היסטוגרמה בהתאמה אישית: מאפיינים בהתאמה אישית מאפשרים ללקוחות של Cloud Talent Solution להגדיר משבצות בהתאמה אישית לחישוב ההיסטוגרמות. לדוגמה, אפשר להשתמש בcustomAttribute כדי לאחסן מידע על ממוצע ציונים מינימלי, ואז ליצור היסטוגרמה בשדה הזה. אפשר גם ליצור קבוצות של ציונים מ-3.0 עד 3.5, מ-3.51 עד 4.0 וכו', כדי לקבץ את כל הציונים המינימליים בתוך הקבוצות האלה.

שימוש במאפיינים מותאמים אישית

יוצרים משימה חדשה עם השדה customAttribute (אפשר להשתמש בערכים מספריים או במחרוזות):

Go

מידע על התקנת ספריית הלקוח של CTS ושימוש בה מופיע במאמר ספריות הלקוח של CTS. מידע נוסף מופיע במאמרי העזרה של CTS Go API.

כדי לבצע אימות ב-CTS, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

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

כברירת מחדל, נקודות הקצה searchJobs ו-searchJobsForAlert מחפשות רק בשדות מוכנים מראש. אם אתם צריכים גם לחפש בשדות customAttribute, אתם יכולים להשתמש בשדה keywordSearchableJobCustomAttributes כדי להגדיר רשימה של מאפיינים מותאמים אישית לחיפוש.

לדוגמה, אם מגייס רוצה להשתמש ב-customAttribute customRequisitions כדי לאחסן את מזהי בקשות המשרה של משרות שמתאימות למעסיק ספציפי, ואם הוא מגדיר את keywordSearchableJobCustomAttributes כך שיכלול את השדה הזה, חיפוש רגיל שמבצע מגייס אחר המונח ABC123 יחזיר את כל המשרות שכוללות את customAttribute customRequisitions עם הערך ABC123.