@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When selecting Ferret ngrams, select term ngrams (not raw ngrams) for term search

Summary:
Ref T12819. For queries like `v0.2`, we would incorrectly search for ngrams including `0.2`, but this is only a substring ngram: the term corpus splits this into `v0` and `2`, so `0.2` is not in the ngrams table.

When executing term queries, search for term ngrams instead. This makes "v0.2" work properly again.

Test Plan: Searched for "v0.2", found a task with "v0.2" in the title.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12819

Differential Revision: https://secure.phabricator.com/D18581

+3 -2
+3 -2
src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
··· 1666 1666 if ($is_substring) { 1667 1667 $ngrams = $engine->getSubstringNgramsFromString($value); 1668 1668 } else { 1669 - $ngrams = $engine->getTermNgramsFromString($value); 1669 + $terms_value = $engine->newTermsCorpus($value); 1670 + $ngrams = $engine->getTermNgramsFromString($terms_value); 1670 1671 1671 1672 // If this is a stemmed term, only look for ngrams present in both the 1672 1673 // unstemmed and stemmed variations. 1673 1674 if ($is_stemmed) { 1674 - $stem_value = $stemmer->stemToken($value); 1675 + $stem_value = $stemmer->stemToken($terms_value); 1675 1676 $stem_ngrams = $engine->getTermNgramsFromString($stem_value); 1676 1677 $ngrams = array_intersect($ngrams, $stem_ngrams); 1677 1678 }