From 600a3e3b7c2de5d93644e0410cd354ea6752949d Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 16 Jun 2015 06:51:51 +1000 Subject: [PATCH] Only index documentable atoms for search Summary: Ref T7458. Only index documentable atoms in the search index. In particular, this prevents files and methods from being returned in search results (clicking on these search results doesn't actually work anyway). Test Plan: Actually, to get this to work I had to destroy the search index and recreate it... is this expected? Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T7458 Differential Revision: https://secure.phabricator.com/D13298 --- src/applications/diviner/search/DivinerAtomSearchIndexer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/diviner/search/DivinerAtomSearchIndexer.php b/src/applications/diviner/search/DivinerAtomSearchIndexer.php index 0e77c6e64c..ea134058f6 100644 --- a/src/applications/diviner/search/DivinerAtomSearchIndexer.php +++ b/src/applications/diviner/search/DivinerAtomSearchIndexer.php @@ -10,6 +10,10 @@ final class DivinerAtomSearchIndexer extends PhabricatorSearchDocumentIndexer { $atom = $this->loadDocumentByPHID($phid); $book = $atom->getBook(); + if (!$atom->getIsDocumentable()) { + return null; + } + $doc = $this->newDocument($phid) ->setDocumentTitle($atom->getTitle()) ->setDocumentCreated($book->getDateCreated())