Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15418878
D8121.id18368.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D8121.id18368.diff
View Options
diff --git a/src/applications/differential/search/DifferentialSearchIndexer.php b/src/applications/differential/search/DifferentialSearchIndexer.php
--- a/src/applications/differential/search/DifferentialSearchIndexer.php
+++ b/src/applications/differential/search/DifferentialSearchIndexer.php
@@ -44,13 +44,13 @@
PhabricatorPeoplePHIDTypeUser::TYPECONST,
$rev->getDateCreated());
- if (!$rev->isClosed()) {
- $doc->addRelationship(
- PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
- $rev->getPHID(),
- DifferentialPHIDTypeRevision::TYPECONST,
- time());
- }
+ $doc->addRelationship(
+ $rev->isClosed()
+ ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
+ : PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
+ $rev->getPHID(),
+ DifferentialPHIDTypeRevision::TYPECONST,
+ time());
$comments = id(new DifferentialCommentQuery())
->withRevisionIDs(array($rev->getID()))
@@ -74,10 +74,19 @@
// If a revision needs review, the owners are the reviewers. Otherwise, the
// owner is the author (e.g., accepted, rejected, closed).
if ($rev->getStatus() == ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) {
- foreach ($rev->getReviewers() as $phid) {
+ $reviewers = $rev->getReviewers();
+ if ($reviewers) {
+ foreach ($reviewers as $phid) {
+ $doc->addRelationship(
+ PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
+ $phid,
+ PhabricatorPeoplePHIDTypeUser::TYPECONST,
+ $rev->getDateModified()); // Bogus timestamp.
+ }
+ } else {
$doc->addRelationship(
- PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
- $phid,
+ PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED,
+ $rev->getPHID(),
PhabricatorPeoplePHIDTypeUser::TYPECONST,
$rev->getDateModified()); // Bogus timestamp.
}
@@ -85,7 +94,7 @@
$doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
$rev->getAuthorPHID(),
- PhabricatorPeoplePHIDTypeUser::TYPECONST,
+ PhabricatorPHIDConstants::PHID_TYPE_VOID,
$rev->getDateCreated());
}
diff --git a/src/applications/maniphest/search/ManiphestSearchIndexer.php b/src/applications/maniphest/search/ManiphestSearchIndexer.php
--- a/src/applications/maniphest/search/ManiphestSearchIndexer.php
+++ b/src/applications/maniphest/search/ManiphestSearchIndexer.php
@@ -30,13 +30,13 @@
PhabricatorPeoplePHIDTypeUser::TYPECONST,
$task->getDateCreated());
- if ($task->getStatus() == ManiphestTaskStatus::STATUS_OPEN) {
- $doc->addRelationship(
- PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
- $task->getPHID(),
- ManiphestPHIDTypeTask::TYPECONST,
- time());
- }
+ $doc->addRelationship(
+ ($task->getStatus() == ManiphestTaskStatus::STATUS_OPEN)
+ ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN
+ : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED,
+ $task->getPHID(),
+ ManiphestPHIDTypeTask::TYPECONST,
+ time());
$this->indexTransactions(
$doc,
@@ -60,12 +60,10 @@
time());
} else {
$doc->addRelationship(
- PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
- ManiphestTaskOwner::OWNER_UP_FOR_GRABS,
- PhabricatorPHIDConstants::PHID_TYPE_MAGIC,
- $owner
- ? $owner->getDateCreated()
- : $task->getDateCreated());
+ PhabricatorSearchRelationship::RELATIONSHIP_UNOWNED,
+ $task->getPHID(),
+ PhabricatorPHIDConstants::PHID_TYPE_VOID,
+ $task->getDateCreated());
}
// We need to load handles here since non-users may subscribe (mailing
diff --git a/src/applications/people/search/PhabricatorUserSearchIndexer.php b/src/applications/people/search/PhabricatorUserSearchIndexer.php
--- a/src/applications/people/search/PhabricatorUserSearchIndexer.php
+++ b/src/applications/people/search/PhabricatorUserSearchIndexer.php
@@ -20,13 +20,13 @@
// TODO: Index the blurbs from their profile or something? Probably not
// actually useful...
- if ($user->isUserActivated()) {
- $doc->addRelationship(
- PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
- $user->getPHID(),
- PhabricatorPeoplePHIDTypeUser::TYPECONST,
- time());
- }
+ $doc->addRelationship(
+ $user->isUserActivated()
+ ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN
+ : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED,
+ $user->getPHID(),
+ PhabricatorPeoplePHIDTypeUser::TYPECONST,
+ time());
return $doc;
}
diff --git a/src/applications/phriction/search/PhrictionSearchIndexer.php b/src/applications/phriction/search/PhrictionSearchIndexer.php
--- a/src/applications/phriction/search/PhrictionSearchIndexer.php
+++ b/src/applications/phriction/search/PhrictionSearchIndexer.php
@@ -37,13 +37,13 @@
PhabricatorPeoplePHIDTypeUser::TYPECONST,
$content->getDateCreated());
- if ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) {
- $doc->addRelationship(
- PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
- $document->getPHID(),
- PhrictionPHIDTypeDocument::TYPECONST,
- time());
- }
+ $doc->addRelationship(
+ ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS)
+ ? PhabricatorSearchRelationship::RELATIONSHIP_OPEN
+ : PhabricatorSearchRelationship::RELATIONSHIP_CLOSED,
+ $document->getPHID(),
+ PhrictionPHIDTypeDocument::TYPECONST,
+ time());
return $doc;
}
diff --git a/src/applications/search/constants/PhabricatorSearchRelationship.php b/src/applications/search/constants/PhabricatorSearchRelationship.php
--- a/src/applications/search/constants/PhabricatorSearchRelationship.php
+++ b/src/applications/search/constants/PhabricatorSearchRelationship.php
@@ -14,5 +14,7 @@
const RELATIONSHIP_REPOSITORY = 'repo';
const RELATIONSHIP_OPEN = 'open';
+ const RELATIONSHIP_CLOSED = 'clos';
+ const RELATIONSHIP_UNOWNED = 'unow';
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 22, 2:03 AM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7716285
Default Alt Text
D8121.id18368.diff (6 KB)
Attached To
Mode
D8121: Allow ApplicationSearch to be offset-paged
Attached
Detach File
Event Timeline
Log In to Comment