Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Dec 8, 2022

Conversation

jczhong84
Copy link
Collaborator

@jczhong84 jczhong84 commented Dec 7, 2022

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
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
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
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.

None yet

2 participants