Cloud Talent Solution allows you to get a histogram representation of the number of
jobs associated to a given search. A histogram search returns a count of all jobs
that match a particular query, broken down by the requested searchType.
For example, a histogram search could return the number of jobs per employment
type (full-time, part-time, etc) that exist in Mountain View, CA. To define the
dimensions and parameters of the histogram, follow this guide.
Histograms are generally run in parallel with a search call, using the same
JobQuery and the same requestMetadata.
Request
The histogram can be obtained from the underlying search API. This is achieved by setting the histogramFacets on the search API and defining the filters of the request. Note that the histogram observes all the filters as defined in the search query. The following example illustrates the mechanism of retrieving a histogram,
Required fields
searchTypesis a list of categories for which to return counts. For example, specifyEMPLOYMENT_TYPEto return a count of employment types, such as full-time or part-time. SeeSearchTypefor a detailed list of enums.
Optional fields
jobQueryis the job query to perform in this search. See Search Filters for more details. In this example, no query is applied.requestMetadatacontains information about the user initiating the search. See theRequestMetadatasection of the job search page for more information.enableBroadeningloosens the restrictions on location and job category of the search request, in order to return more results. For example, if a request specified jobs within a 20 mile radius of a location, setting this flag totruemay return jobs from outside of that radius. The following example does not include broadened results.
Examples
The following example returns the list of job counts across the COMPANY_ID
and the customAttribute someFieldName1:
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Go
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Relevance thresholding
Histogram requests do not use relevance thresholding. To ensure that the counts
are consistent between a histogram search and an identical job search,
disableKeywordMatch in the job search must be false.