@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.

Correct some straggling Ferret/Cursor interactions

Summary:
See PHI1182. Ref T13266. The recent fixes didn't quite cover the case where you have a query, but order by something other than relevance, and page forward.

Refine the tests around building/selecting these columns and paging values a little bit to be more specific about what they care about.

Test Plan:
Executed queries, then went to "Next Page", for:

- query text, non-relevance order.
- query text, relevance order.
- no query text, non-relevance order.
- no query text, relevance order.

Also, made an API call similar to the one in PHI1182.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13266

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

+23 -4
+23 -4
src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
··· 212 212 } 213 213 214 214 if ($this->supportsFerretEngine()) { 215 - if ($this->getFerretTokens()) { 215 + if ($this->hasFerretOrder()) { 216 216 $map += array( 217 217 'rank' => 218 218 $cursor->getRawRowProperty(self::FULLTEXT_RANK), ··· 1840 1840 return $select; 1841 1841 } 1842 1842 1843 - $vector = $this->getOrderVector(); 1844 - if (!$vector->containsKey('rank')) { 1845 - // We only need to SELECT the virtual "_ft_rank" column if we're 1843 + if (!$this->hasFerretOrder()) { 1844 + // We only need to SELECT the virtual rank/relevance columns if we're 1846 1845 // actually sorting the results by rank. 1847 1846 return $select; 1848 1847 } 1849 1848 1850 1849 if (!$this->ferretEngine) { 1851 1850 $select[] = qsprintf($conn, '0 AS %T', self::FULLTEXT_RANK); 1851 + $select[] = qsprintf($conn, '0 AS %T', self::FULLTEXT_CREATED); 1852 + $select[] = qsprintf($conn, '0 AS %T', self::FULLTEXT_MODIFIED); 1852 1853 return $select; 1853 1854 } 1854 1855 ··· 3150 3151 '%Q IS NULL', 3151 3152 $col); 3152 3153 } 3154 + } 3155 + 3156 + private function hasFerretOrder() { 3157 + $vector = $this->getOrderVector(); 3158 + 3159 + if ($vector->containsKey('rank')) { 3160 + return true; 3161 + } 3162 + 3163 + if ($vector->containsKey('fulltext-created')) { 3164 + return true; 3165 + } 3166 + 3167 + if ($vector->containsKey('fulltext-modified')) { 3168 + return true; 3169 + } 3170 + 3171 + return false; 3153 3172 } 3154 3173 3155 3174 }