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
F15448329: D18593.id44654.diff
Fri, Mar 28, 4:13 AM
F15444161: D18593.id44644.diff
Thu, Mar 27, 8:12 AM
F15441161: D18593.diff
Wed, Mar 26, 4:44 PM
F15437018: D18593.id.diff
Tue, Mar 25, 5:03 PM
F15431302: D18593.diff
Mon, Mar 24, 11:40 AM
F15422344: D18593.id.diff
Sat, Mar 22, 7:27 AM
F15378984: D18593.diff
Thu, Mar 13, 5:59 PM
F15368771: D18593.id44644.diff
Wed, Mar 12, 3:51 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