@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove the "search_documentfield" table

Summary: Ref T11741. See PHI1276. After the switch to "Ferret", this table has no remaining readers or writers.

Test Plan:
- Ran `bin/storage upgrade -f`, no warnings.
- Grepped for class name, table name, `stemmedCorpus` column; got no relevant hits.
- Did a fulltext search.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T11741

Differential Revision: https://secure.phabricator.com/D20549

+5 -72
+4 -31
resources/sql/autopatches/20161130.search.02.rebuild.php
··· 1 1 <?php 2 2 3 - 4 - $use_mysql = false; 5 - 6 - $services = PhabricatorSearchService::getAllServices(); 7 - foreach ($services as $service) { 8 - $engine = $service->getEngine(); 9 - if ($engine instanceof PhabricatorMySQLFulltextStorageEngine) { 10 - $use_mysql = true; 11 - } 12 - } 3 + // See T11741. Long ago, in T11922, we switched from "MyISAM FULLTEXT" to 4 + // "InnoDB FULLTEXT". This migration prompted installs to rebuild the index. 13 5 14 - if ($use_mysql) { 15 - $field = new PhabricatorSearchDocumentField(); 16 - $conn = $field->establishConnection('r'); 17 - 18 - // We're only going to require this if the index isn't empty: if you're on a 19 - // fresh install, you don't have to do anything. 20 - $any_documents = queryfx_one( 21 - $conn, 22 - 'SELECT * FROM %T LIMIT 1', 23 - $field->getTableName()); 24 - 25 - if ($any_documents) { 26 - try { 27 - id(new PhabricatorConfigManualActivity()) 28 - ->setActivityType(PhabricatorConfigManualActivity::TYPE_REINDEX) 29 - ->save(); 30 - } catch (AphrontDuplicateKeyQueryException $ex) { 31 - // If we've already noted that this activity is required, just move on. 32 - } 33 - } 34 - } 6 + // Later, in T12974, we switched from "InnoDB FULLTEXT" to "Ferret", mostly 7 + // mooting this. The underlying tables and engines were later removed entirely.
+1
resources/sql/autopatches/20190523.myisam.01.documentfield.sql
··· 1 + DROP TABLE IF EXISTS {$NAMESPACE}_search.search_documentfield;
-2
src/__phutil_library_map__.php
··· 4530 4530 'PhabricatorSearchDefaultController' => 'applications/search/controller/PhabricatorSearchDefaultController.php', 4531 4531 'PhabricatorSearchDeleteController' => 'applications/search/controller/PhabricatorSearchDeleteController.php', 4532 4532 'PhabricatorSearchDocument' => 'applications/search/storage/document/PhabricatorSearchDocument.php', 4533 - 'PhabricatorSearchDocumentField' => 'applications/search/storage/document/PhabricatorSearchDocumentField.php', 4534 4533 'PhabricatorSearchDocumentFieldType' => 'applications/search/constants/PhabricatorSearchDocumentFieldType.php', 4535 4534 'PhabricatorSearchDocumentQuery' => 'applications/search/query/PhabricatorSearchDocumentQuery.php', 4536 4535 'PhabricatorSearchDocumentRelationship' => 'applications/search/storage/document/PhabricatorSearchDocumentRelationship.php', ··· 10874 10873 'PhabricatorSearchDefaultController' => 'PhabricatorSearchBaseController', 10875 10874 'PhabricatorSearchDeleteController' => 'PhabricatorSearchBaseController', 10876 10875 'PhabricatorSearchDocument' => 'PhabricatorSearchDAO', 10877 - 'PhabricatorSearchDocumentField' => 'PhabricatorSearchDAO', 10878 10876 'PhabricatorSearchDocumentFieldType' => 'Phobject', 10879 10877 'PhabricatorSearchDocumentQuery' => 'PhabricatorPolicyAwareQuery', 10880 10878 'PhabricatorSearchDocumentRelationship' => 'PhabricatorSearchDAO',
-39
src/applications/search/storage/document/PhabricatorSearchDocumentField.php
··· 1 - <?php 2 - 3 - final class PhabricatorSearchDocumentField extends PhabricatorSearchDAO { 4 - 5 - protected $phidType; 6 - protected $field; 7 - protected $auxPHID; 8 - protected $corpus; 9 - protected $stemmedCorpus; 10 - 11 - protected function getConfiguration() { 12 - return array( 13 - self::CONFIG_TIMESTAMPS => false, 14 - self::CONFIG_IDS => self::IDS_MANUAL, 15 - self::CONFIG_COLUMN_SCHEMA => array( 16 - 'phidType' => 'text4', 17 - 'field' => 'text4', 18 - 'auxPHID' => 'phid?', 19 - 'corpus' => 'fulltext?', 20 - 'stemmedCorpus' => 'fulltext?', 21 - ), 22 - self::CONFIG_KEY_SCHEMA => array( 23 - 'key_phid' => null, 24 - 'phid' => array( 25 - 'columns' => array('phid'), 26 - ), 27 - 'key_corpus' => array( 28 - 'columns' => array('corpus', 'stemmedCorpus'), 29 - 'type' => 'FULLTEXT', 30 - ), 31 - ), 32 - ) + parent::getConfiguration(); 33 - } 34 - 35 - public function getIDKey() { 36 - return 'phid'; 37 - } 38 - 39 - }