מאפיינים מותאמים אישית (גרסה 3)

‫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 (אפשר להשתמש בערכים מספריים או בערכי מחרוזת):

Java

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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
}

יצירת מסנן בשדה customAttribute:

Java

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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
}

יצירת מסנן נוסף עם customAttribute:

Java

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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
}

שימוש במאפיינים מותאמים אישית כדי להקל על סינון בין שדות:

בדוגמה הבאה מוסבר איך להגדיר בקשת חיפוש של משרות עם שיעור בונוס יעד בין 10% ל-20%, או משרה שנדרשות בה מיומנויות של 'ניהול צוות', או משרה שיש לה ערך לא ריק בשדה customAttribute visa_required.

Java

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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

מידע נוסף על התקנה ויצירה של לקוח Cloud Talent Solution זמין במאמר ספריות לקוח של 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
}

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

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