From 6052bc1933442122e946d6528de87488c752bddb Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 17 Apr 2017 12:46:09 -0700 Subject: [PATCH] Extend "fulltext" and "ngrams" interfaces from "indexable" interface Summary: Ref T8788. See D17702. This allows `bin/search index` to index stuff which only implements `Ngrams`, not `Fulltext`. Test Plan: Kinda poked around `bin/search index` a bit, yell if you hit more issues deeper down the stack? Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T8788 Differential Revision: https://secure.phabricator.com/D17704 --- src/__phutil_library_map__.php | 3 +++ .../search/interface/PhabricatorFulltextInterface.php | 3 ++- .../search/interface/PhabricatorIndexableInterface.php | 3 +++ .../search/interface/PhabricatorNgramsInterface.php | 3 ++- .../management/PhabricatorSearchManagementIndexWorkflow.php | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/applications/search/interface/PhabricatorIndexableInterface.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 5bc5f78d96..5d6bd37460 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2924,6 +2924,7 @@ phutil_register_library_map(array( 'PhabricatorIndexEngine' => 'applications/search/index/PhabricatorIndexEngine.php', 'PhabricatorIndexEngineExtension' => 'applications/search/index/PhabricatorIndexEngineExtension.php', 'PhabricatorIndexEngineExtensionModule' => 'applications/search/index/PhabricatorIndexEngineExtensionModule.php', + 'PhabricatorIndexableInterface' => 'applications/search/interface/PhabricatorIndexableInterface.php', 'PhabricatorInfrastructureTestCase' => '__tests__/PhabricatorInfrastructureTestCase.php', 'PhabricatorInlineCommentController' => 'infrastructure/diff/PhabricatorInlineCommentController.php', 'PhabricatorInlineCommentInterface' => 'infrastructure/diff/interface/PhabricatorInlineCommentInterface.php', @@ -8025,6 +8026,7 @@ phutil_register_library_map(array( 'PhabricatorFulltextEngineExtension' => 'Phobject', 'PhabricatorFulltextEngineExtensionModule' => 'PhabricatorConfigModule', 'PhabricatorFulltextIndexEngineExtension' => 'PhabricatorIndexEngineExtension', + 'PhabricatorFulltextInterface' => 'PhabricatorIndexableInterface', 'PhabricatorFulltextResultSet' => 'Phobject', 'PhabricatorFulltextStorageEngine' => 'Phobject', 'PhabricatorFulltextToken' => 'Phobject', @@ -8299,6 +8301,7 @@ phutil_register_library_map(array( 'PhabricatorNavigationRemarkupRule' => 'PhutilRemarkupRule', 'PhabricatorNeverTriggerClock' => 'PhabricatorTriggerClock', 'PhabricatorNgramsIndexEngineExtension' => 'PhabricatorIndexEngineExtension', + 'PhabricatorNgramsInterface' => 'PhabricatorIndexableInterface', 'PhabricatorNotificationBuilder' => 'Phobject', 'PhabricatorNotificationClearController' => 'PhabricatorNotificationController', 'PhabricatorNotificationClient' => 'Phobject', diff --git a/src/applications/search/interface/PhabricatorFulltextInterface.php b/src/applications/search/interface/PhabricatorFulltextInterface.php index 5cbde615b2..e8f4cca29f 100644 --- a/src/applications/search/interface/PhabricatorFulltextInterface.php +++ b/src/applications/search/interface/PhabricatorFulltextInterface.php @@ -1,6 +1,7 @@ setAncestorClass('PhabricatorFulltextInterface') + ->setAncestorClass('PhabricatorIndexableInterface') ->execute(); $normalized_type = phutil_utf8_strtolower($type);