Conversation
The multi-word branch of get_text_query_on_title() added fuzziness='AUTO' on top of the already-stemmed contentheavy fields. Stemming already shortens words, so two unrelated short stems can end up just one edit apart (e.g. "Gerbier" and "Gerri" both stem towards "gerbi"/"geri", one edit apart) - fuzziness on top of that made the query match titles that share no real word with the query, sometimes outranking the actual match (e.g. "Arêtes de Gerbier" surfacing "Pic de Gerri : arête Noris - Gerri" ahead of "Gerbier : Traversée des arêtes"). The single-word branch keeps its fuzziness (it isn't stacked on stemming, since that field uses an ngram/prefix analyzer instead), and typo tolerance wasn't part of what the multi-word AND rewrite was meant to add in the first place - dropping it here doesn't reduce recall for the originally reported issues (word order, hyphenated compounds), only the false positives. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage · +0.00% coverage variation
Metric Results Coverage variation ✅ +0.00% coverage variation Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (dd1ce78) 22269 20594 92.48% Head commit (df6d23d) 22272 (+3) 20597 (+3) 92.48% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#2251) 3 3 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_text_query_on_title()addedfuzziness='AUTO'on top of the already-stemmedcontentheavyfields. Stemming already shortens words, so two unrelated short stems can end up just one edit apart (e.g. "Gerbier" and "Gerri" both stem towardsgerbi/geri, one edit apart) - fuzziness on top of that made the query match titles sharing no real word with the query, sometimes outranking the actual match: "Arêtes de Gerbier" was surfacing "Pic de Gerri : arête Noris - Gerri" ahead of "Gerbier : Traversée des arêtes"._explainon a synthetic index built with the real analyzer settings: the query analyzes to['aret', 'gerbi'], and "Pic de Gerri..." only matched because its stemmed "geri" token was within the allowed 1-edit fuzzy distance of "gerbi".fuzzinessfrom that clause fixes the false positive without reducing recall for the cases Fix multi-word title search ignoring word order and hyphens #2247 was meant to fix (word order, hyphenated compounds) - typo tolerance was never functional on that branch before Fix multi-word title search ignoring word order and hyphens #2247 either (the oldphrasequery silently ignored itsfuzzinessparameter).Test plan
test_search_multiword_any_order) with a decoy title that reproduces the false positive; confirmed it fails without this fix and passes with it.pytest c2corg_api/tests/search/ c2corg_api/tests/views/test_search.py(39 passed), rerun twice for stability.flake8clean.