Page MenuHomePhabricator

D17596.id42331.diff
No OneTemporary

D17596.id42331.diff

diff --git a/src/applications/project/search/PhabricatorProjectFulltextEngine.php b/src/applications/project/search/PhabricatorProjectFulltextEngine.php
--- a/src/applications/project/search/PhabricatorProjectFulltextEngine.php
+++ b/src/applications/project/search/PhabricatorProjectFulltextEngine.php
@@ -8,17 +8,26 @@
$object) {
$project = $object;
+ $viewer = $this->getViewer();
+
+ // Reload the project to get slugs.
+ $project = id(new PhabricatorProjectQuery())
+ ->withIDs(array($project->getID()))
+ ->setViewer($viewer)
+ ->needSlugs(true)
+ ->executeOne();
+
$project->updateDatasourceTokens();
- $document->setDocumentTitle($project->getDisplayName());
- $document->addField(PhabricatorSearchDocumentFieldType::FIELD_KEYWORDS,
- $project->getPrimarySlug());
- try {
- $slugs = $project->getSlugs();
- foreach ($slugs as $slug) {}
- } catch (PhabricatorDataNotAttachedException $e) {
- // ignore
+ $slugs = array();
+ foreach ($project->getSlugs() as $slug) {
+ $slugs[] = $slug->getSlug();
}
+ $body = implode("\n", $slugs);
+
+ $document
+ ->setDocumentTitle($project->getDisplayName())
+ ->addField(PhabricatorSearchDocumentFieldType::FIELD_BODY, $body);
$document->addRelationship(
$project->isArchived()
diff --git a/src/applications/search/constants/PhabricatorSearchDocumentFieldType.php b/src/applications/search/constants/PhabricatorSearchDocumentFieldType.php
--- a/src/applications/search/constants/PhabricatorSearchDocumentFieldType.php
+++ b/src/applications/search/constants/PhabricatorSearchDocumentFieldType.php
@@ -5,6 +5,5 @@
const FIELD_TITLE = 'titl';
const FIELD_BODY = 'body';
const FIELD_COMMENT = 'cmnt';
- const FIELD_KEYWORDS = 'kwrd';
}

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 24, 10:53 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225646
Default Alt Text
D17596.id42331.diff (1 KB)

Event Timeline