Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
feat: Added a new KeywordMatchMode field to support more keyword ma…
Browse files Browse the repository at this point in the history
…tching options feat: Added more `DiversificationLevel` configuration options (#159)

* feat: Added a new `KeywordMatchMode` field to support more keyword matching options feat: Added more `DiversificationLevel` configuration options

PiperOrigin-RevId: 396667150

Source-Link: googleapis/googleapis@caad48d

Source-Link: googleapis/googleapis-gen@1ac7721
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWFjNzcyMWZiNmFhYmE4MjExYjI1YmEwYWRiOWE4ZWZmYjliYTFhMyJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Sep 16, 2021
1 parent 112e35d commit 4626497
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
55 changes: 54 additions & 1 deletion google/cloud/talent_v4/types/job_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,18 @@ class SearchJobsRequest(proto.Message):
top of existing relevance score (determined by
API algorithm).
disable_keyword_match (bool):
This field is deprecated. Please use
[SearchJobsRequest.keyword_match_mode][google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode]
going forward.
To migrate, disable_keyword_match set to false maps to
[KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL],
and disable_keyword_match set to true maps to
[KeywordMatchMode.KEYWORD_MATCH_DISABLED][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED].
If
[SearchJobsRequest.keyword_match_mode][google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode]
is set, this field is ignored.
Controls whether to disable exact keyword match on
[Job.title][google.cloud.talent.v4.Job.title],
[Job.description][google.cloud.talent.v4.Job.description],
Expand All @@ -492,6 +504,14 @@ class SearchJobsRequest(proto.Message):
recall of subsequent search requests.
Defaults to false.
keyword_match_mode (google.cloud.talent_v4.types.SearchJobsRequest.KeywordMatchMode):
Controls what keyword match options to use. If both
keyword_match_mode and disable_keyword_match are set,
keyword_match_mode will take precedence.
Defaults to
[KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL]
if no value is specified.
"""

class SearchMode(proto.Enum):
Expand All @@ -510,10 +530,42 @@ class DiversificationLevel(proto.Enum):
representative job of the cluster is displayed to the job seeker
higher up in the results, with the other jobs being displayed
lower down in the results.
If you are using pageToken to page through the result set,
latency might be lower but we can't guarantee that all results
are returned. If you are using page offset, latency might be
higher but all results are returned.
"""
DIVERSIFICATION_LEVEL_UNSPECIFIED = 0
DISABLED = 1
SIMPLE = 2
ONE_PER_COMPANY = 3
TWO_PER_COMPANY = 4
DIVERSIFY_BY_LOOSER_SIMILARITY = 5

class KeywordMatchMode(proto.Enum):
r"""Controls what keyword matching behavior the search has. When keyword
matching is enabled, a keyword match returns jobs that may not match
given category filters when there are matching keywords. For
example, for the query "program manager" with KeywordMatchMode set
to KEYWORD_MATCH_ALL, a job posting with the title "software
developer," which doesn't fall into "program manager" ontology, and
"program manager" appearing in its description will be surfaced.
For queries like "cloud" that don't contain title or location
specific ontology, jobs with "cloud" keyword matches are returned
regardless of this enum's value.
Use
[Company.keyword_searchable_job_custom_attributes][google.cloud.talent.v4.Company.keyword_searchable_job_custom_attributes]
if company-specific globally matched custom field/attribute string
values are needed. Enabling keyword match improves recall of
subsequent search requests.
"""
KEYWORD_MATCH_MODE_UNSPECIFIED = 0
KEYWORD_MATCH_DISABLED = 1
KEYWORD_MATCH_ALL = 2
KEYWORD_MATCH_TITLE_ONLY = 3

class CustomRankingInfo(proto.Message):
r"""Custom ranking information for
Expand Down Expand Up @@ -542,7 +594,7 @@ class CustomRankingInfo(proto.Message):
evaluated to a number.
Parenthesis are supported to adjust calculation precedence.
The expression must be < 100 characters in length.
The expression must be < 200 characters in length.
The expression is considered invalid for a job if the
expression references custom attributes that are not
Expand Down Expand Up @@ -595,6 +647,7 @@ class ImportanceLevel(proto.Enum):
proto.MESSAGE, number=14, message=CustomRankingInfo,
)
disable_keyword_match = proto.Field(proto.BOOL, number=16,)
keyword_match_mode = proto.Field(proto.ENUM, number=18, enum=KeywordMatchMode,)


class SearchJobsResponse(proto.Message):
Expand Down
4 changes: 2 additions & 2 deletions scripts/fixup_talent_v4_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class talentCallTransformer(cst.CSTTransformer):
'list_companies': ('parent', 'page_token', 'page_size', 'require_open_jobs', ),
'list_jobs': ('parent', 'filter', 'page_token', 'page_size', 'job_view', ),
'list_tenants': ('parent', 'page_token', 'page_size', ),
'search_jobs': ('parent', 'request_metadata', 'search_mode', 'job_query', 'enable_broadening', 'histogram_queries', 'job_view', 'offset', 'max_page_size', 'page_token', 'order_by', 'diversification_level', 'custom_ranking_info', 'disable_keyword_match', ),
'search_jobs_for_alert': ('parent', 'request_metadata', 'search_mode', 'job_query', 'enable_broadening', 'histogram_queries', 'job_view', 'offset', 'max_page_size', 'page_token', 'order_by', 'diversification_level', 'custom_ranking_info', 'disable_keyword_match', ),
'search_jobs': ('parent', 'request_metadata', 'search_mode', 'job_query', 'enable_broadening', 'histogram_queries', 'job_view', 'offset', 'max_page_size', 'page_token', 'order_by', 'diversification_level', 'custom_ranking_info', 'disable_keyword_match', 'keyword_match_mode', ),
'search_jobs_for_alert': ('parent', 'request_metadata', 'search_mode', 'job_query', 'enable_broadening', 'histogram_queries', 'job_view', 'offset', 'max_page_size', 'page_token', 'order_by', 'diversification_level', 'custom_ranking_info', 'disable_keyword_match', 'keyword_match_mode', ),
'update_company': ('company', 'update_mask', ),
'update_job': ('job', 'update_mask', ),
'update_tenant': ('tenant', 'update_mask', ),
Expand Down

0 comments on commit 4626497

Please sign in to comment.