Page MenuHomePhabricator

Remove broken and unfixable "prefix" ngram behavior
ClosedPublic

Authored by epriestley on Apr 16 2020, 4:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 9 2025, 11:53 AM
Unknown Object (File)
May 8 2025, 10:00 AM
Unknown Object (File)
May 5 2025, 5:05 PM
Unknown Object (File)
Apr 13 2025, 4:57 AM
Unknown Object (File)
Apr 8 2025, 8:29 PM
Unknown Object (File)
Apr 8 2025, 1:36 AM
Unknown Object (File)
Apr 5 2025, 7:49 PM
Unknown Object (File)
Apr 5 2025, 11:48 AM
Subscribers
None

Details

Summary

Ref T13501. The older ngram code has some "prefix" behavior that tries to handle cases where a user issues a very short (one or two character) query.

This code doesn't work, presumably never worked, and can not be made to work (or, at least, I don't see a way, and am fairly sure one does not exist).

If the user searches for "xy", we can find trigrams in the form "xy*" using the index, but not in the form "*xy". The code makes a misguided effort to look for " xy", but this will only find "xy" in words that begin with "xy", like "xylophone".

For example, searching Files for "om" does not currently find "random.txt".

Remove this behavior. Without engaging the trigram index, these queries fall back to an unidexed "LIKE" table scan, but that's about the best we can do.

Test Plan

Searched for "om", hit "random.txt".

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable