Page MenuHomePhabricator

Remove broken and unfixable "prefix" ngram behavior
ClosedPublic

Authored by epriestley on Apr 16 2020, 4:32 PM.
Tags
None
Referenced Files
F13521850: D21127.diff
Fri, Jul 26, 5:59 AM
Unknown Object (File)
Mon, Jul 22, 2:32 PM
Unknown Object (File)
Mon, Jul 22, 1:14 PM
Unknown Object (File)
Mon, Jul 22, 12:10 PM
Unknown Object (File)
Mon, Jul 22, 12:00 PM
Unknown Object (File)
Sun, Jul 21, 8:39 AM
Unknown Object (File)
Wed, Jul 17, 9:42 AM
Unknown Object (File)
Sun, Jul 14, 1:52 PM
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