Page MenuHomePhabricator

D20354.diff
No OneTemporary

D20354.diff

diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
--- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
+++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
@@ -212,7 +212,7 @@
}
if ($this->supportsFerretEngine()) {
- if ($this->getFerretTokens()) {
+ if ($this->hasFerretOrder()) {
$map += array(
'rank' =>
$cursor->getRawRowProperty(self::FULLTEXT_RANK),
@@ -1840,15 +1840,16 @@
return $select;
}
- $vector = $this->getOrderVector();
- if (!$vector->containsKey('rank')) {
- // We only need to SELECT the virtual "_ft_rank" column if we're
+ if (!$this->hasFerretOrder()) {
+ // We only need to SELECT the virtual rank/relevance columns if we're
// actually sorting the results by rank.
return $select;
}
if (!$this->ferretEngine) {
$select[] = qsprintf($conn, '0 AS %T', self::FULLTEXT_RANK);
+ $select[] = qsprintf($conn, '0 AS %T', self::FULLTEXT_CREATED);
+ $select[] = qsprintf($conn, '0 AS %T', self::FULLTEXT_MODIFIED);
return $select;
}
@@ -3152,4 +3153,22 @@
}
}
+ private function hasFerretOrder() {
+ $vector = $this->getOrderVector();
+
+ if ($vector->containsKey('rank')) {
+ return true;
+ }
+
+ if ($vector->containsKey('fulltext-created')) {
+ return true;
+ }
+
+ if ($vector->containsKey('fulltext-modified')) {
+ return true;
+ }
+
+ return false;
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 6:30 AM (21 h, 7 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6789784
Default Alt Text
D20354.diff (1 KB)

Event Timeline