@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.

Add Ferret engine index support to Differential

Summary: Ref T12819. Adds storage and indexing for the Ferret engine to Differential.

Test Plan: Ran `bin/search index D123 --force`, saw indexes appear in database. No UI/user impact yet.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12819

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

+108
+9
resources/sql/autopatches/20170905.ferret.01.diff.doc.sql
··· 1 + CREATE TABLE {$NAMESPACE}_differential.differential_revision_fdocument ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + objectPHID VARBINARY(64) NOT NULL, 4 + isClosed BOOL NOT NULL, 5 + authorPHID VARBINARY(64), 6 + ownerPHID VARBINARY(64), 7 + epochCreated INT UNSIGNED NOT NULL, 8 + epochModified INT UNSIGNED NOT NULL 9 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+8
resources/sql/autopatches/20170905.ferret.02.diff.field.sql
··· 1 + CREATE TABLE {$NAMESPACE}_differential.differential_revision_ffield ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + documentID INT UNSIGNED NOT NULL, 4 + fieldKey VARCHAR(4) NOT NULL COLLATE {$COLLATE_TEXT}, 5 + rawCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}, 6 + termCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}, 7 + normalCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT} 8 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+5
resources/sql/autopatches/20170905.ferret.03.diff.ngrams.sql
··· 1 + CREATE TABLE {$NAMESPACE}_differential.differential_revision_fngrams ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + documentID INT UNSIGNED NOT NULL, 4 + ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT} 5 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+9
src/__phutil_library_map__.php
··· 532 532 'DifferentialRevisionEditConduitAPIMethod' => 'applications/differential/conduit/DifferentialRevisionEditConduitAPIMethod.php', 533 533 'DifferentialRevisionEditController' => 'applications/differential/controller/DifferentialRevisionEditController.php', 534 534 'DifferentialRevisionEditEngine' => 'applications/differential/editor/DifferentialRevisionEditEngine.php', 535 + 'DifferentialRevisionFerretDocument' => 'applications/differential/storage/DifferentialRevisionFerretDocument.php', 536 + 'DifferentialRevisionFerretEngine' => 'applications/differential/search/DifferentialRevisionFerretEngine.php', 537 + 'DifferentialRevisionFerretField' => 'applications/differential/storage/DifferentialRevisionFerretField.php', 538 + 'DifferentialRevisionFerretNgrams' => 'applications/differential/storage/DifferentialRevisionFerretNgrams.php', 535 539 'DifferentialRevisionFulltextEngine' => 'applications/differential/search/DifferentialRevisionFulltextEngine.php', 536 540 'DifferentialRevisionGraph' => 'infrastructure/graph/DifferentialRevisionGraph.php', 537 541 'DifferentialRevisionHasChildRelationship' => 'applications/differential/relationships/DifferentialRevisionHasChildRelationship.php', ··· 5522 5526 'PhabricatorDestructibleInterface', 5523 5527 'PhabricatorProjectInterface', 5524 5528 'PhabricatorFulltextInterface', 5529 + 'PhabricatorFerretInterface', 5525 5530 'PhabricatorConduitResultInterface', 5526 5531 'PhabricatorDraftInterface', 5527 5532 ), ··· 5545 5550 'DifferentialRevisionEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 5546 5551 'DifferentialRevisionEditController' => 'DifferentialController', 5547 5552 'DifferentialRevisionEditEngine' => 'PhabricatorEditEngine', 5553 + 'DifferentialRevisionFerretDocument' => 'PhabricatorFerretDocument', 5554 + 'DifferentialRevisionFerretEngine' => 'PhabricatorFerretEngine', 5555 + 'DifferentialRevisionFerretField' => 'PhabricatorFerretField', 5556 + 'DifferentialRevisionFerretNgrams' => 'PhabricatorFerretNgrams', 5548 5557 'DifferentialRevisionFulltextEngine' => 'PhabricatorFulltextEngine', 5549 5558 'DifferentialRevisionGraph' => 'PhabricatorObjectGraph', 5550 5559 'DifferentialRevisionHasChildRelationship' => 'DifferentialRevisionRelationship',
+26
src/applications/differential/search/DifferentialRevisionFerretEngine.php
··· 1 + <?php 2 + 3 + final class DifferentialRevisionFerretEngine 4 + extends PhabricatorFerretEngine { 5 + 6 + public function newNgramsObject() { 7 + return new DifferentialRevisionFerretNgrams(); 8 + } 9 + 10 + public function newDocumentObject() { 11 + return new DifferentialRevisionFerretDocument(); 12 + } 13 + 14 + public function newFieldObject() { 15 + return new DifferentialRevisionFerretField(); 16 + } 17 + 18 + protected function getFunctionMap() { 19 + $map = parent::getFunctionMap(); 20 + 21 + $map['body']['aliases'][] = 'summary'; 22 + 23 + return $map; 24 + } 25 + 26 + }
+9
src/applications/differential/storage/DifferentialRevision.php
··· 15 15 PhabricatorDestructibleInterface, 16 16 PhabricatorProjectInterface, 17 17 PhabricatorFulltextInterface, 18 + PhabricatorFerretInterface, 18 19 PhabricatorConduitResultInterface, 19 20 PhabricatorDraftInterface { 20 21 ··· 897 898 898 899 public function newFulltextEngine() { 899 900 return new DifferentialRevisionFulltextEngine(); 901 + } 902 + 903 + 904 + /* -( PhabricatorFerretInterface )----------------------------------------- */ 905 + 906 + 907 + public function newFerretEngine() { 908 + return new DifferentialRevisionFerretEngine(); 900 909 } 901 910 902 911
+14
src/applications/differential/storage/DifferentialRevisionFerretDocument.php
··· 1 + <?php 2 + 3 + final class DifferentialRevisionFerretDocument 4 + extends PhabricatorFerretDocument { 5 + 6 + public function getApplicationName() { 7 + return 'differential'; 8 + } 9 + 10 + public function getIndexKey() { 11 + return 'revision'; 12 + } 13 + 14 + }
+14
src/applications/differential/storage/DifferentialRevisionFerretField.php
··· 1 + <?php 2 + 3 + final class DifferentialRevisionFerretField 4 + extends PhabricatorFerretField { 5 + 6 + public function getApplicationName() { 7 + return 'differential'; 8 + } 9 + 10 + public function getIndexKey() { 11 + return 'revision'; 12 + } 13 + 14 + }
+14
src/applications/differential/storage/DifferentialRevisionFerretNgrams.php
··· 1 + <?php 2 + 3 + final class DifferentialRevisionFerretNgrams 4 + extends PhabricatorFerretNgrams { 5 + 6 + public function getApplicationName() { 7 + return 'differential'; 8 + } 9 + 10 + public function getIndexKey() { 11 + return 'revision'; 12 + } 13 + 14 + }