Skip to content

fix: boost table score for exact match when searching table - #1097

Merged
czgu merged 5 commits into
pinterest:masterfrom
jczhong84:fix/tablesearch
Dec 8, 2022
Merged

czgu merged 5 commits into
pinterest:masterfrom
jczhong84:fix/tablesearch

Conversation

@jczhong84

@jczhong84 jczhong84 commented Dec 7, 2022 •

Copy link
Copy Markdown
Collaborator

The previous tuning of https://github.com/pinterest/querybook/pull/631/files will boost score for all phrase match, not limited to exact match. e.g.

query: default.hello_world

candidate 1: default.hello_world
candidate 2: default.hello_world_v2

both candidate 1 and 2 will have the phrase match, while candidate 1 is the exact match.

This change will boost another score for the exact match of candidate 1.

if dot_index == -1:
return None, keywords

return keywords[:dot_index], keywords[dot_index + 1 :]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is autoformatted?

keywords[dot_index + 1:]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

if table_schema:
filters.append(["schema", table_schema])

should_clause = _match_table_phrase_queries(fields, keywords)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem like should_clause need to be between the two if statements, can you move it to top?

@czgu
czgu merged commit d75c1d1 into pinterest:master Dec 8, 2022
rohan-sh1 pushed a commit to CAI-TECHNOLOGIES/cai-ext-db-explorer that referenced this pull request Feb 28, 2023
@jczhong84
jczhong84 deleted the fix/tablesearch branch April 7, 2023 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants