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
F18204476: D18593.id44644.diff
Mon, Aug 18, 1:47 PM
F18195279: D18593.id.diff
Sun, Aug 17, 2:54 PM
F18182777: D18593.diff
Sat, Aug 16, 10:18 AM
F17980508: D18593.diff
Fri, Aug 1, 6:46 PM
F17857467: D18593.id44654.diff
Jul 27 2025, 6:32 PM
F17853318: D18593.id44644.diff
Jul 27 2025, 1:45 PM
F17853044: D18593.id44644.diff
Jul 27 2025, 1:22 PM
F17846619: D18593.id.diff
Jul 27 2025, 5:06 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