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
Unknown Object (File)
Sat, May 31, 2:35 PM
Unknown Object (File)
May 29 2025, 3:57 PM
Unknown Object (File)
May 28 2025, 12:14 PM
Unknown Object (File)
Apr 30 2025, 12:21 AM
Unknown Object (File)
Apr 29 2025, 2:17 PM
Unknown Object (File)
Apr 27 2025, 3:32 PM
Unknown Object (File)
Apr 26 2025, 10:12 AM
Unknown Object (File)
Apr 20 2025, 1:46 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