Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14841219
D20660.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20660.id.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 2, 1:10 PM (7 m, 50 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7084499
Default Alt Text
D20660.id.diff (1 KB)
Attached To
Mode
D20660: In Ferret, allow documents with no title to match query terms by using LEFT JOIN on the "title" ranking field
Attached
Detach File
Event Timeline
Log In to Comment