Page MenuHomePhabricator

Fix an issue with selecting the right stemmed ngrams with Ferret engine queries
ClosedPublic

Authored by epriestley on Sep 12 2017, 2:48 PM.
Tags
None
Referenced Files
F18741293: D18593.diff
Thu, Oct 2, 11:39 AM
F18659707: D18593.id.diff
Tue, Sep 23, 3:09 PM
F18654458: D18593.diff
Mon, Sep 22, 9:56 AM
F18628876: D18593.id44654.diff
Tue, Sep 16, 7:29 AM
F18621855: D18593.id.diff
Mon, Sep 15, 9:40 AM
F18611492: D18593.diff
Sun, Sep 14, 7:21 AM
F18509107: D18593.id.diff
Sep 5 2025, 3:13 AM
F18501612: D18593.diff
Sep 4 2025, 9:51 PM
Subscribers
None

Details

Summary

Ref T12819. In D18581, I corrected one bug (ngram selection for terms) but introduced a minor new bug. We now pass ' query ' (term corpus with boundary spaces) to the stemmer, but it bails out on this since English words don't start with spaces.

Trim these extra boundary spaces off before invoking the stemmer.

The practical effect of this is that searching for non-stem variations of a word ("detection") now finds stemmed variations again ("detect"). Prior to fixing this bug, the stem could find longer variations but not the other way around.

Test Plan

Searched for "detection", found results matching "detect" after patch (and saw same results for "detect" and "detection").

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable