Suchfilter (v3)

Optional kann eine Jobsuche einen oder mehrere JobQuery - Filter enthalten, die die Jobsuche nach verschiedenen Kriterien wie Standort, Unternehmen, Vergütung und mehr einschränken. Die Felder JobQuery sind in der Referenz JobQuery markiert.

Standort

Mit der Standortsuche können Sie einen geografischen Radius oder Bereich angeben, innerhalb dessen gesucht werden soll.

Weitere Informationen finden Sie unter Standortbasierte Suche.

Jobkategorie

Gibt Jobs zurück, die zu einer bestimmten von Cloud Talent Solution festgelegten Kategorie gehören. Kategorien sind vordefiniert und umfassen beispielsweise ACCOUNTING_AND_FINANCE und EDUCATION. Alle Kategorien werden von den Cloud Talent Solution-Modellen bestimmt und für die Verwendung im Hinblick auf das kategoriebasierte Faceting empfohlen. Eine vollständige Liste finden Sie auf der Referenzseite JobCategory.

Java

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


/** Search on category filter. */
public static void categoryFilterSearch(String companyName, List<String> categories)
    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");

  JobQuery jobQuery = new JobQuery().setJobCategories(categories);
  if (companyName != null) {
    jobQuery.setCompanyNames(Arrays.asList(companyName));
  }

  SearchJobsRequest searchJobsRequest =
      new SearchJobsRequest()
          .setRequestMetadata(requestMetadata)
          .setJobQuery(jobQuery) // Set the actual search term as defined in the jobQurey
          .setSearchMode("JOB_SEARCH"); // Set the search mode to a regular search

  SearchJobsResponse searchJobsResponse =
      talentSolutionClient
          .projects()
          .jobs()
          .search(DEFAULT_PROJECT_ID, searchJobsRequest)
          .execute();
  Thread.sleep(1000);

  System.out.printf("Category search jobs results: %s\n", searchJobsResponse);
}

Python

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.

def category_search(client_service, company_name, categories):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }
    job_query = {"job_categories": categories}
    if company_name is not None:
        job_query.update({"company_names": [company_name]})
    request = {
        "search_mode": "JOB_SEARCH",
        "request_metadata": request_metadata,
        "job_query": job_query,
    }

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

Go

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


// categoryFilterSearch searches for jobs on category filter.
func categoryFilterSearch(w io.Writer, projectID, companyName string, categories []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)
	}

	jobQuery := &talent.JobQuery{
		JobCategories: categories,
	}
	if companyName != "" {
		jobQuery.CompanyNames = []string{companyName}
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		// 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",
		},
		// Set the actual search term as defined in the jobQuery.
		JobQuery: jobQuery,
		// Set the search mode to a regular search.
		SearchMode: "JOB_SEARCH",
	}
	resp, err := service.Projects.Jobs.Search(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with categories %v: %w", categories, err)
	}

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

	return resp, nil
}

Beschäftigungstyp

Gibt Jobs zurück, die zu einer oder mehreren Beschäftigungstypdefinitionen wie FULL_TIME oder VOLUNTEER gehören. Eine vollständige Liste finden Sie auf der Referenzseite EmploymentType.

Java

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


/** Search on employment types. */
public static void employmentTypesSearch(String companyName, List<String> employmentTypes)
    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");

  JobQuery jobQuery = new JobQuery().setEmploymentTypes(employmentTypes);
  if (companyName != null) {
    jobQuery.setCompanyNames(Arrays.asList(companyName));
  }

  SearchJobsRequest searchJobsRequest =
      new SearchJobsRequest()
          .setRequestMetadata(requestMetadata)
          .setJobQuery(jobQuery) // Set the actual search term as defined in the jobQurey
          .setSearchMode("JOB_SEARCH"); // Set the search mode to a regular searchch

  SearchJobsResponse searchJobsResponse =
      talentSolutionClient
          .projects()
          .jobs()
          .search(DEFAULT_PROJECT_ID, searchJobsRequest)
          .execute();
  Thread.sleep(1000);

  System.out.printf("Employee type search jobs results: %s\n", searchJobsResponse);
}

Python

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.

def employment_types_search(client_service, company_name, employment_types):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }
    job_query = {"employment_types": employment_types}
    if company_name is not None:
        job_query.update({"company_names": [company_name]})
    request = {
        "search_mode": "JOB_SEARCH",
        "request_metadata": request_metadata,
        "job_query": job_query,
    }

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

Go

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


// employmentTypesSearch searches for jobs on employment types.
func employmentTypesSearch(w io.Writer, projectID, companyName string, employmentTypes []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)
	}

	jobQuery := &talent.JobQuery{
		EmploymentTypes: employmentTypes,
	}
	if companyName != "" {
		jobQuery.CompanyNames = []string{companyName}
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		// 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",
		},
		// Set the actual search term as defined in the jobQuery.
		JobQuery: jobQuery,
		// Set the search mode to a regular search.
		SearchMode: "JOB_SEARCH",
	}
	resp, err := service.Projects.Jobs.Search(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with employment types %v: %w", employmentTypes, err)
	}

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

	return resp, nil
}

Zeitraum

Schränkt die Suche auf Jobs ein, die innerhalb des angegebenen Datumsbereichs veröffentlicht wurden. Die zulässigen Werte sind auf der Referenzseite publishTimeRange aufgeführt.

Java

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


/**
 * Search on date range. In JSON format, the Timestamp type is encoded as a string in the [RFC
 * 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is
 * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" e.g. "2017-01-15T01:30:15.01Z"
 */
public static void dateRangeSearch(String companyName, String startTime, String endTime)
    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");

  TimestampRange timestampRange =
      new TimestampRange().setStartTime(startTime).setEndTime(endTime);

  JobQuery jobQuery = new JobQuery().setPublishTimeRange(timestampRange);
  // JobQuery jobQuery = new JobQuery().setPublishTimeRange(dateRange);

  if (companyName != null) {
    jobQuery.setCompanyNames(Arrays.asList(companyName));
  }

  SearchJobsRequest searchJobsRequest =
      new SearchJobsRequest()
          .setRequestMetadata(requestMetadata)
          .setJobQuery(jobQuery) // Set the actual search term as defined in the jobQurey
          .setSearchMode("JOB_SEARCH"); // Set the search mode to a regular search

  SearchJobsResponse searchJobsResponse =
      talentSolutionClient
          .projects()
          .jobs()
          .search(DEFAULT_PROJECT_ID, searchJobsRequest)
          .execute();
  Thread.sleep(1000);

  System.out.printf("Search results on jobs with a date range: %s\n", searchJobsResponse);
}

Python

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.

def date_range_search(client_service, company_name, date_range):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }
    job_query = {"publish_time_range": date_range}
    if company_name is not None:
        job_query.update({"company_names": [company_name]})
    request = {
        "search_mode": "JOB_SEARCH",
        "request_metadata": request_metadata,
        "job_query": job_query,
    }

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

Go

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


// /dateRangeSearch searches for jobs on date range.
// In JSON format, the Timestamp type is encoded as a string in the
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
// e.g. "2017-01-15T01:30:15.01Z".
func dateRangeSearch(w io.Writer, projectID, companyName, startTime, endTime 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)
	}

	jobQuery := &talent.JobQuery{
		PublishTimeRange: &talent.TimestampRange{
			StartTime: startTime,
			EndTime:   endTime,
		},
	}
	if companyName != "" {
		jobQuery.CompanyNames = []string{companyName}
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		// 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",
		},
		// Set the actual search term as defined in the jobQuery.
		JobQuery: jobQuery,
		// Set the search mode to a regular search.
		SearchMode: "JOB_SEARCH",
	}
	resp, err := service.Projects.Jobs.Search(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with date range [%s, %s]: %w", startTime, endTime, err)
	}

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

	return resp, nil
}

Sprachcode

Gibt Jobs zurück, die dem angegebenen Sprachcode entsprechen, wie im Feld languageCode des Jobs festgelegt. Dieses Feld gibt die Sprache der Jobanzeige an und bezieht sich nicht auf sprachliche Anforderungen.

Java

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


/** Search on language codes. */
public static void languageCodeSearch(String companyName, List<String> languageCodes)
    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");

  JobQuery jobQuery = new JobQuery().setLanguageCodes(languageCodes);
  if (companyName != null) {
    jobQuery.setCompanyNames(Arrays.asList(companyName));
  }

  SearchJobsRequest searchJobsRequest =
      new SearchJobsRequest()
          .setRequestMetadata(requestMetadata)
          .setJobQuery(jobQuery) // Set the actual search term as defined in the jobQurey
          .setSearchMode("JOB_SEARCH"); // Set the search mode to a regular search

  SearchJobsResponse searchJobsResponse =
      talentSolutionClient
          .projects()
          .jobs()
          .search(DEFAULT_PROJECT_ID, searchJobsRequest)
          .execute();
  Thread.sleep(1000);

  System.out.printf("Search results on jobs with a language code: %s\n", searchJobsResponse);
}

Python

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.

def language_code_search(client_service, company_name, language_codes):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }
    job_query = {"language_codes": language_codes}
    if company_name is not None:
        job_query.update({"company_names": [company_name]})
    request = {
        "search_mode": "JOB_SEARCH",
        "request_metadata": request_metadata,
        "job_query": job_query,
    }

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

Go

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


// languageCodeSearch searches for jobs on language code.
func languageCodeSearch(w io.Writer, projectID, companyName string, languageCodes []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)
	}

	jobQuery := &talent.JobQuery{
		LanguageCodes: languageCodes,
	}
	if companyName != "" {
		jobQuery.CompanyNames = []string{companyName}
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		// 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",
		},
		// Set the actual search term as defined in the jobQuery.
		JobQuery: jobQuery,
		// Set the search mode to a regular search.
		SearchMode: "JOB_SEARCH",
	}
	resp, err := service.Projects.Jobs.Search(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with languange codes %v: %w", languageCodes, err)
	}

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

	return resp, nil
}

displayName des Unternehmens

Gibt Jobs von Unternehmen zurück, deren displayName dem angegebenen Textstring entspricht. Beachten Sie, dass displayName der für Menschen lesbare Name des Unternehmens (z. B. "Google") ist, im Gegensatz zu name, bei dem es sich um eine generierte ID handelt (z. B. "Unternehmen/80df2034-176e-44a8-b763-b5370f2463a5"). Informationen zur Suche nach Namen finden Sie unter displayName des Unternehmens.

Sie können die Genauigkeit mithilfe von Vorschlägen zur automatischen Vervollständigung erhöhen.

Java

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


/** Search on company display name. */
public static void companyDisplayNameSearch(String companyName, List<String> companyDisplayNames)
    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");

  JobQuery jobQuery = new JobQuery().setCompanyDisplayNames(companyDisplayNames);
  if (companyName != null) {
    jobQuery.setCompanyNames(Arrays.asList(companyName));
  }

  SearchJobsRequest searchJobsRequest =
      new SearchJobsRequest()
          .setRequestMetadata(requestMetadata)
          .setJobQuery(jobQuery) // Set the actual search term as defined in the jobQurey
          .setSearchMode("JOB_SEARCH"); // Set the search mode to a regular search

  SearchJobsResponse searchJobsResponse =
      talentSolutionClient
          .projects()
          .jobs()
          .search(DEFAULT_PROJECT_ID, searchJobsRequest)
          .execute();
  Thread.sleep(1000);

  System.out.printf("Search results by display name of company: %s\n", searchJobsResponse);
}

Python

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.

def company_display_name_search(client_service, company_name, company_display_names):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }
    job_query = {"company_display_names": company_display_names}
    if company_name is not None:
        job_query.update({"company_names": [company_name]})
    request = {
        "search_mode": "JOB_SEARCH",
        "request_metadata": request_metadata,
        "job_query": job_query,
    }

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

Go

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


// companyDisplayNameSearch searches for job on company display names.
func companyDisplayNameSearch(w io.Writer, projectID, companyName string, companyDisplayNames []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)
	}

	jobQuery := &talent.JobQuery{
		CompanyDisplayNames: companyDisplayNames,
	}
	if companyName != "" {
		jobQuery.CompanyNames = []string{companyName}
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		// 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",
		},
		// Set the actual search term as defined in the jobQuery.
		JobQuery: jobQuery,
		// Set the search mode to a regular search.
		SearchMode: "JOB_SEARCH",
	}
	resp, err := service.Projects.Jobs.Search(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with company display names %v: %w", companyDisplayNames, err)
	}

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

	return resp, nil
}

Anfahrtszeit

Mit einer Suche nach Anfahrtszeit können Sie eine maximale Fahr- oder Pendelzeit angeben, anhand derer Jobs zurückgegeben werden sollen. Sie können die Uhrzeit angeben, für die Verkehrsdaten zu verwenden sind.

Weitere Informationen finden Sie auf der Referenzseite Suche in Abhängigkeit von der Anfahrtszeit.

Vergütung

Filtert Suchergebnisse anhand von Vergütungsbeträgen. Die compensationFilter sieht so aus:

"compensationFilter": {
  "type": enum(FilterType),
  "units": [
    enum(CompensationUnit)
  ],
  "range": {
    object(CompensationRange)
  },
  "includeJobWithUnspecifiedCompensationRange": boolean,
}

Wobei:

  • type ist erforderlich und gibt die Felder an, nach denen gesucht werden soll. Wenn Sie beispielsweise nach Jobs suchen möchten, die stündlich bezahlt werden, geben Sie hier UNIT_ONLY und HOURLY in der Liste compensationUnits an.

  • units ist eine Liste von Aufzählungen für die Zahlungshäufigkeit, z. B. HOURLY und MONTHLY. Eine vollständige Liste finden Sie auf der Referenzseite CompensationUnit.

  • range gibt die Mindest- und Höchstwerte an, die zurückgegeben werden sollen, im angegebenen currencyCode, einem dreistelligen Währungscode, und mit der angegebenen Zahlungshäufigkeit. Lassen Sie currencyCode leer, um alle Jobs unabhängig von der Währung zurückzugeben. Verwenden Sie diesen Filter beispielsweise, um nach Jobs mit einer Vergütung von 10,50 bis 15 $ pro Stunde zu suchen.

Java

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


/** Search on compensation. */
public static void compensationSearch(String companyName)
    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");

  // Search jobs that pay between 10.50 and 15 USD per hour
  JobQuery jobQuery =
      new JobQuery()
          .setCompensationFilter(
              new CompensationFilter()
                  .setType("UNIT_AND_AMOUNT")
                  .setUnits(Arrays.asList("HOURLY"))
                  .setRange(
                      new CompensationRange()
                          .setMaxCompensation(new Money().setCurrencyCode("USD").setUnits(15L))
                          .setMinCompensation(
                              new Money()
                                  .setCurrencyCode("USD")
                                  .setUnits(10L)
                                  .setNanos(500000000))));
  if (companyName != null) {
    jobQuery.setCompanyNames(Arrays.asList(companyName));
  }

  SearchJobsRequest searchJobsRequest =
      new SearchJobsRequest()
          .setRequestMetadata(requestMetadata)
          .setJobQuery(jobQuery) // Set the actual search term as defined in the jobQurey
          .setSearchMode("JOB_SEARCH"); // Set the search mode to a regular search

  SearchJobsResponse searchJobsResponse =
      talentSolutionClient
          .projects()
          .jobs()
          .search(DEFAULT_PROJECT_ID, searchJobsRequest)
          .execute();
  Thread.sleep(1000);

  System.out.printf("Search results by compensation: %s\n", searchJobsResponse);
}

Python

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.

def compensation_search(client_service, company_name):
    request_metadata = {
        "user_id": "HashedUserId",
        "session_id": "HashedSessionId",
        "domain": "www.google.com",
    }
    compensation_range = {
        "max_compensation": {"currency_code": "USD", "units": 15},
        "min_compensation": {"currency_code": "USD", "units": 10, "nanos": 500000000},
    }
    compensation_filter = {
        "type": "UNIT_AND_AMOUNT",
        "units": ["HOURLY"],
        "range": compensation_range,
    }
    job_query = {"compensation_filter": compensation_filter}
    if company_name is not None:
        job_query.update({"company_names": [company_name]})
    request = {
        "search_mode": "JOB_SEARCH",
        "request_metadata": request_metadata,
        "job_query": job_query,
    }

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

Go

Weitere Informationen zum Installieren und Erstellen eines Cloud Talent Solution-Clients finden Sie unter Cloud Talent Solution-Clientbibliotheken.


// compensationSearch searches for job on compensation.
func compensationSearch(w io.Writer, projectID, companyName 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)
	}

	jobQuery := &talent.JobQuery{
		CompensationFilter: &talent.CompensationFilter{
			Type:  "UNIT_AND_AMOUNT",
			Units: []string{"HOURLY"},
			Range: &talent.CompensationRange{
				MaxCompensation: &talent.Money{
					Units:        15,
					CurrencyCode: "USD",
				},
				MinCompensation: &talent.Money{
					Units:        10,
					CurrencyCode: "USD",
					Nanos:        500000000,
				},
			},
		},
	}
	if companyName != "" {
		jobQuery.CompanyNames = []string{companyName}
	}

	parent := "projects/" + projectID
	req := &talent.SearchJobsRequest{
		// 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",
		},
		// Set the actual search term as defined in the jobQuery.
		JobQuery: jobQuery,
		// Set the search mode to a regular search.
		SearchMode: "JOB_SEARCH",
	}
	resp, err := service.Projects.Jobs.Search(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to search for jobs with compensation: %w", err)
	}

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

	return resp, nil
}
Hinweis: Das Feld nanos erwartet Nanoeinheiten, also 10^-9. Eine Einheit umfasst 1.000.000.000 Nano.

  • includeJobWithUnspecifiedCompensationRange gibt an, ob Jobs ohne Vergütungsinformationen eingeschlossen werden sollen. Der Standardwert ist "false" und gibt keine Jobs ohne Vergütungswerte zurück.

Code für die Abfragesprache

query_language_code gibt die Sprache des Abfragestrings im BCP-47-Format an, z. B. "en-US". Wenn Sie dieses Feld leer lassen, ist die Standardeinstellung US-Englisch. Dieses Feld bezieht sich nicht auf languageCode, das die Sprache der zurückgegebenen Joblisten angibt. Weitere Informationen finden Sie in der JobQuery-Dokumentation. Beispielcode:

   "jobQuery":
   {"query":"general", "query_language_code":"fr-FR"}}