Filtros de pesquisa (v3)

Opcionalmente, uma pesquisa de vagas pode incluir um ou mais filtros JobQuery que restringem a pesquisa seguindo critérios diferentes, como local, empresas, remuneração e muito mais. Os campos JobQuery estão marcados na referência de JobQuery.

Local

A pesquisa por local permite especificar um raio ou uma área geográfica onde pesquisar.

Consulte Pesquisa baseada em local para mais informações.

Categoria da vaga

Retorne vagas pertencentes a uma categoria específica, conforme identificado pela Cloud Talent Solution. As categorias são predefinidas e incluem, por exemplo, ACCOUNTING_AND_FINANCE e EDUCATION. Todas as categorias são determinadas pelos modelos do Cloud Talent Solution e são recomendadas para uso em termos de atributos baseados em categorias. Para uma lista completa, consulte a página de referência de JobCategory.

Java

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


/** 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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.

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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


// 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
}

Tipo de emprego

Retorne vagas pertencentes a uma ou mais definições de tipo de emprego, como FULL_TIME ou VOLUNTEER. Para ver uma lista completa, consulte a página de referência de EmploymentType.

Java

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


/** 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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.

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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


// 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
}

Período

Restringe a pesquisa a vagas publicadas dentro do período especificado. Os valores aceitos estão listados na página de referência de publishTimeRange.

Java

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


/**
 * 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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.

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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


// /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
}

Código do idioma

Retorna vagas correspondentes ao código do idioma especificado, conforme determinado pelo campo languageCode das vagas. Esse campo especifica o idioma da postagem de vaga e não se refere aos requisitos de fluência do idioma.

Java

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


/** 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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.

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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


// 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
}

Nome de exibição da empresa

Retorna vagas de empresas cujo displayName corresponde à string de texto fornecida. Observe que displayName é o nome legível por humanos da empresa (como "Google"), ao contrário de name, que é um ID gerado (como "empresas/80df2034-176e-44a8-b763-b5370f2463a5"). Consulte displayName da empresa para pesquisa de nome.

Aumente a precisão usando sugestões de preenchimento automático.

Java

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


/** 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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.

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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


// 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
}

Deslocamento diário

A pesquisa por deslocamento permite especificar um tempo máximo de direção ou trânsito para retornar vagas. Especifique a hora do dia para usar os dados de tráfego.

Saiba mais na página de referência de Pesquisa por deslocamento diário.

Remuneração

Filtra resultados da pesquisa com base em valores de remuneração. O compensationFilter é semelhante a:

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

Em que:

  • type é obrigatório e especifica os campos para pesquisa. Por exemplo, para procurar vagas que pagam qualquer valor a cada hora, especifique UNIT_ONLY aqui e HOURLY na lista compensationUnits.

  • units é uma lista de enumerações de frequência de pagamento, como HOURLY e MONTHLY. Consulte a página de referência de CompensationUnit para uma lista completa.

  • range especifica os valores mínimo e máximo que devem ser retornados, no currencyCode especificado, que é um código de moeda de 3 letras (em inglês) e na frequência de pagamento especificada. Deixe currencyCode em branco para retornar todas as vagas, independentemente da moeda. Por exemplo, use esse filtro para procurar vagas que paguem entre 10,50 e 15 dólares por hora.

Java

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


/** 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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.

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

Para mais informações sobre a instalação e criação de um cliente do Cloud Talent Solution, consulte Bibliotecas de cliente do Cloud Talent Solution.


// 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
}
Observação: o campo nanos espera unidades nano, que são 10^-9. Há 1.000.000.000 de nanos em uma unidade.

  • includeJobWithUnspecifiedCompensationRange especifica se é necessário incluir vagas sem informações de remuneração. O padrão é falso e não retorna vagas sem valores de remuneração.

Código do idioma da consulta

query_language_code especifica o idioma da string de consulta no formato BCP-47, por exemplo, "en-US". Se ficar em branco, o padrão será inglês dos EUA. Este campo não está relacionado a languageCode, que especifica o idioma das listas de vagas retornadas. Consulte a documentação de JobQuery para detalhes. Exemplo de código:

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