Page MenuHomePhabricator

D20660.diff
No OneTemporary

D20660.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
@@ -1825,6 +1825,11 @@
$table_map['rank'] = array(
'alias' => 'ft_rank',
'key' => PhabricatorSearchDocumentFieldType::FIELD_TITLE,
+
+ // See T13345. Not every document has a title, so we want to LEFT JOIN
+ // this table to avoid excluding documents with no title that match
+ // the query in other fields.
+ 'optional' => true,
);
$this->ferretTables = $table_map;
@@ -2103,10 +2108,17 @@
foreach ($this->ferretTables as $table) {
$alias = $table['alias'];
+ if (empty($table['optional'])) {
+ $join_type = qsprintf($conn, 'JOIN');
+ } else {
+ $join_type = qsprintf($conn, 'LEFT JOIN');
+ }
+
$joins[] = qsprintf(
$conn,
- 'JOIN %T %T ON ft_doc.id = %T.documentID
+ '%Q %T %T ON ft_doc.id = %T.documentID
AND %T.fieldKey = %s',
+ $join_type,
$field_table,
$alias,
$alias,

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 23, 3:03 PM (20 h, 45 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7037310
Default Alt Text
D20660.diff (1 KB)

Event Timeline