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
F15560380: D18593.id44644.diff
Tue, Apr 29, 2:17 PM
F15551165: D18593.id.diff
Sun, Apr 27, 3:32 PM
F15545335: D18593.diff
Sat, Apr 26, 10:12 AM
F15519966: D18593.diff
Sun, Apr 20, 1:46 AM
F15511274: D18593.diff
Thu, Apr 17, 12:52 AM
F15505361: D18593.diff
Tue, Apr 15, 2:34 AM
F15448329: D18593.id44654.diff
Mar 28 2025, 4:13 AM
F15444161: D18593.id44644.diff
Mar 27 2025, 8:12 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