-
Notifications
You must be signed in to change notification settings - Fork 202
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
Changed "exact match boost" implementation to use a match_phrase query in should #4978
Conversation
dd Sutori to the "Made with Openverse" page.
Fixed commit message to be more precise and include the issue number
Fixed commit message to be more precise and include the issue number
I added the suggestion from @sarayourfriend. Co-authored-by: sarayourfriend <[email protected]>
… in should #4960 I have added support for "match_pharse" and also removed variable quotes_stripped it's not needed now.
…in should #4960 I have added support for "match_pharse" and also removed variable quotes_stripped it's not needed now.
and also removed variable quotes_stripped it's not needed now.
hi @sarayourfriend, |
Sure! You should run #! /usr/bin/env bash
export TERM=xterm
./ov hook pre-commit "$@"
|
Hey @sarayourfriend, thanks for your help getting this PR to work. I really appreciate it. Can you please take a look at the PR and suggest any changes that might be needed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @dryruffian!
"flags": DEFAULT_SQS_FLAGS, | ||
"match_phrase": { | ||
"title": { | ||
"query": '"The cutest cat"', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For other reviewers who notice this double-quoting. It's preserved from the input string. It shouldn't be a problem, it seems that (at least with our current analyser configuration for title) match_phrase
filters our non-alphanumeric tokens in search. For example, a query for "house cat photo"
(with the quotes) ends up as this, for the match_phrase
part of the scoring, and is identical if I drop the quotes in the query string.
{
"value": 10000,
"description": "weight(title:\"hous cat photo\" in 95) [PerFieldSimilarity], result of:",
"details": [
{
"value": 10000,
"description": "score(BooleanWeight), computed from:",
"details": [
{
"value": 10000,
"description": "boost, query boost",
"details": []
}
]
}
]
}
Fixes
Fixes #4960 by @sarayourfriend
Description
This pull request changes the usage of
simple_query_string
tomatch_phrase
as suggested by @sarayourfriend. This will bypass simple query string altogether for this, saving some parsing cycles in Elasticsearch. It will also make our intention much clearer in code (and in the generated query) by usingmatch_phrase
directly.Checklist
Update index.md
).main
) or a parent feature branch.ov just catalog/generate-docs
for catalogPRs) or the media properties generator (
ov just catalog/generate-docs media-props
for the catalog or
ov just api/generate-docs
for the API) where applicable.Developer Certificate of Origin
Developer Certificate of Origin