Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15447429
D18572.id44585.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D18572.id44585.diff
View Options
diff --git a/resources/sql/autopatches/20170907.ferret.31.repo.doc.sql b/resources/sql/autopatches/20170907.ferret.31.repo.doc.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.31.repo.doc.sql
@@ -0,0 +1,9 @@
+CREATE TABLE {$NAMESPACE}_repository.repository_repository_fdocument (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ objectPHID VARBINARY(64) NOT NULL,
+ isClosed BOOL NOT NULL,
+ authorPHID VARBINARY(64),
+ ownerPHID VARBINARY(64),
+ epochCreated INT UNSIGNED NOT NULL,
+ epochModified INT UNSIGNED NOT NULL
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20170907.ferret.32.repo.field.sql b/resources/sql/autopatches/20170907.ferret.32.repo.field.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.32.repo.field.sql
@@ -0,0 +1,8 @@
+CREATE TABLE {$NAMESPACE}_repository.repository_repository_ffield (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ documentID INT UNSIGNED NOT NULL,
+ fieldKey VARCHAR(4) NOT NULL COLLATE {$COLLATE_TEXT},
+ rawCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
+ termCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
+ normalCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20170907.ferret.33.repo.ngrams.sql b/resources/sql/autopatches/20170907.ferret.33.repo.ngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.33.repo.ngrams.sql
@@ -0,0 +1,5 @@
+CREATE TABLE {$NAMESPACE}_repository.repository_repository_fngrams (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ documentID INT UNSIGNED NOT NULL,
+ ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT}
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20170907.ferret.34.commit.doc.sql b/resources/sql/autopatches/20170907.ferret.34.commit.doc.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.34.commit.doc.sql
@@ -0,0 +1,9 @@
+CREATE TABLE {$NAMESPACE}_repository.repository_commit_fdocument (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ objectPHID VARBINARY(64) NOT NULL,
+ isClosed BOOL NOT NULL,
+ authorPHID VARBINARY(64),
+ ownerPHID VARBINARY(64),
+ epochCreated INT UNSIGNED NOT NULL,
+ epochModified INT UNSIGNED NOT NULL
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20170907.ferret.35.commit.field.sql b/resources/sql/autopatches/20170907.ferret.35.commit.field.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.35.commit.field.sql
@@ -0,0 +1,8 @@
+CREATE TABLE {$NAMESPACE}_repository.repository_commit_ffield (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ documentID INT UNSIGNED NOT NULL,
+ fieldKey VARCHAR(4) NOT NULL COLLATE {$COLLATE_TEXT},
+ rawCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
+ termCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
+ normalCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20170907.ferret.36.commit.ngrams.sql b/resources/sql/autopatches/20170907.ferret.36.commit.ngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.36.commit.ngrams.sql
@@ -0,0 +1,5 @@
+CREATE TABLE {$NAMESPACE}_repository.repository_commit_fngrams (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ documentID INT UNSIGNED NOT NULL,
+ ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT}
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -652,6 +652,7 @@
'DiffusionCommitEditConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionCommitEditConduitAPIMethod.php',
'DiffusionCommitEditController' => 'applications/diffusion/controller/DiffusionCommitEditController.php',
'DiffusionCommitEditEngine' => 'applications/diffusion/editor/DiffusionCommitEditEngine.php',
+ 'DiffusionCommitFerretEngine' => 'applications/repository/search/DiffusionCommitFerretEngine.php',
'DiffusionCommitFulltextEngine' => 'applications/repository/search/DiffusionCommitFulltextEngine.php',
'DiffusionCommitHasPackageEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasPackageEdgeType.php',
'DiffusionCommitHasRevisionEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasRevisionEdgeType.php',
@@ -3807,6 +3808,7 @@
'PhabricatorRepositoryDiscoveryEngine' => 'applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php',
'PhabricatorRepositoryEditor' => 'applications/repository/editor/PhabricatorRepositoryEditor.php',
'PhabricatorRepositoryEngine' => 'applications/repository/engine/PhabricatorRepositoryEngine.php',
+ 'PhabricatorRepositoryFerretEngine' => 'applications/repository/search/PhabricatorRepositoryFerretEngine.php',
'PhabricatorRepositoryFulltextEngine' => 'applications/repository/search/PhabricatorRepositoryFulltextEngine.php',
'PhabricatorRepositoryGitCommitChangeParserWorker' => 'applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php',
'PhabricatorRepositoryGitCommitMessageParserWorker' => 'applications/repository/worker/commitmessageparser/PhabricatorRepositoryGitCommitMessageParserWorker.php',
@@ -5673,6 +5675,7 @@
'DiffusionCommitEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'DiffusionCommitEditController' => 'DiffusionController',
'DiffusionCommitEditEngine' => 'PhabricatorEditEngine',
+ 'DiffusionCommitFerretEngine' => 'PhabricatorFerretEngine',
'DiffusionCommitFulltextEngine' => 'PhabricatorFulltextEngine',
'DiffusionCommitHasPackageEdgeType' => 'PhabricatorEdgeType',
'DiffusionCommitHasRevisionEdgeType' => 'PhabricatorEdgeType',
@@ -9308,6 +9311,7 @@
'PhabricatorSpacesInterface',
'PhabricatorConduitResultInterface',
'PhabricatorFulltextInterface',
+ 'PhabricatorFerretInterface',
),
'PhabricatorRepositoryAuditRequest' => array(
'PhabricatorRepositoryDAO',
@@ -9328,6 +9332,7 @@
'PhabricatorCustomFieldInterface',
'PhabricatorApplicationTransactionInterface',
'PhabricatorFulltextInterface',
+ 'PhabricatorFerretInterface',
'PhabricatorConduitResultInterface',
'PhabricatorDraftInterface',
),
@@ -9350,6 +9355,7 @@
'PhabricatorRepositoryDiscoveryEngine' => 'PhabricatorRepositoryEngine',
'PhabricatorRepositoryEditor' => 'PhabricatorApplicationTransactionEditor',
'PhabricatorRepositoryEngine' => 'Phobject',
+ 'PhabricatorRepositoryFerretEngine' => 'PhabricatorFerretEngine',
'PhabricatorRepositoryFulltextEngine' => 'PhabricatorFulltextEngine',
'PhabricatorRepositoryGitCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker',
'PhabricatorRepositoryGitCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker',
diff --git a/src/applications/repository/search/DiffusionCommitFerretEngine.php b/src/applications/repository/search/DiffusionCommitFerretEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/repository/search/DiffusionCommitFerretEngine.php
@@ -0,0 +1,18 @@
+<?php
+
+final class DiffusionCommitFerretEngine
+ extends PhabricatorFerretEngine {
+
+ public function getApplicationName() {
+ return 'repository';
+ }
+
+ public function getScopeName() {
+ return 'commit';
+ }
+
+ public function newSearchEngine() {
+ return new PhabricatorCommitSearchEngine();
+ }
+
+}
diff --git a/src/applications/repository/search/PhabricatorRepositoryFerretEngine.php b/src/applications/repository/search/PhabricatorRepositoryFerretEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/repository/search/PhabricatorRepositoryFerretEngine.php
@@ -0,0 +1,18 @@
+<?php
+
+final class PhabricatorRepositoryFerretEngine
+ extends PhabricatorFerretEngine {
+
+ public function getApplicationName() {
+ return 'repository';
+ }
+
+ public function getScopeName() {
+ return 'repository';
+ }
+
+ public function newSearchEngine() {
+ return new PhabricatorRepositorySearchEngine();
+ }
+
+}
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -16,7 +16,8 @@
PhabricatorProjectInterface,
PhabricatorSpacesInterface,
PhabricatorConduitResultInterface,
- PhabricatorFulltextInterface {
+ PhabricatorFulltextInterface,
+ PhabricatorFerretInterface {
/**
* Shortest hash we'll recognize in raw "a829f32" form.
@@ -2633,4 +2634,12 @@
return new PhabricatorRepositoryFulltextEngine();
}
+
+/* -( PhabricatorFerretInterface )----------------------------------------- */
+
+
+ public function newFerretEngine() {
+ return new PhabricatorRepositoryFerretEngine();
+ }
+
}
diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
--- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
@@ -15,6 +15,7 @@
PhabricatorCustomFieldInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorFulltextInterface,
+ PhabricatorFerretInterface,
PhabricatorConduitResultInterface,
PhabricatorDraftInterface {
@@ -712,6 +713,14 @@
}
+/* -( PhabricatorFerretInterface )----------------------------------------- */
+
+
+ public function newFerretEngine() {
+ return new DiffusionCommitFerretEngine();
+ }
+
+
/* -( PhabricatorConduitResultInterface )---------------------------------- */
public function getFieldSpecificationsForConduit() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 28, 11:50 PM (1 w, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7665498
Default Alt Text
D18572.id44585.diff (9 KB)
Attached To
Mode
D18572: Support the Ferret engine in Diffusion
Attached
Detach File
Event Timeline
Log In to Comment