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
F12189741: D18593.id44654.diff
Tue, Sep 19, 7:23 PM
F12176936: D18593.id.diff
Sun, Sep 10, 4:25 PM
F12167995: D18593.diff
Thu, Sep 7, 3:52 AM
F12156448: D18593.diff
Mon, Sep 4, 11:10 PM
F12133905: D18593.diff
Aug 25 2023, 2:08 AM
Unknown Object (File)
Jul 18 2023, 1:30 PM
Unknown Object (File)
Jul 16 2023, 11:44 PM
Unknown Object (File)
Jul 14 2023, 8:26 AM
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