Page MenuHomePhabricator

D18540.id.diff
No OneTemporary

D18540.id.diff

diff --git a/resources/sql/autopatches/20170905.ferret.01.diff.doc.sql b/resources/sql/autopatches/20170905.ferret.01.diff.doc.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170905.ferret.01.diff.doc.sql
@@ -0,0 +1,9 @@
+CREATE TABLE {$NAMESPACE}_differential.differential_revision_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/20170905.ferret.02.diff.field.sql b/resources/sql/autopatches/20170905.ferret.02.diff.field.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170905.ferret.02.diff.field.sql
@@ -0,0 +1,8 @@
+CREATE TABLE {$NAMESPACE}_differential.differential_revision_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/20170905.ferret.03.diff.ngrams.sql b/resources/sql/autopatches/20170905.ferret.03.diff.ngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170905.ferret.03.diff.ngrams.sql
@@ -0,0 +1,5 @@
+CREATE TABLE {$NAMESPACE}_differential.differential_revision_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
@@ -532,6 +532,10 @@
'DifferentialRevisionEditConduitAPIMethod' => 'applications/differential/conduit/DifferentialRevisionEditConduitAPIMethod.php',
'DifferentialRevisionEditController' => 'applications/differential/controller/DifferentialRevisionEditController.php',
'DifferentialRevisionEditEngine' => 'applications/differential/editor/DifferentialRevisionEditEngine.php',
+ 'DifferentialRevisionFerretDocument' => 'applications/differential/storage/DifferentialRevisionFerretDocument.php',
+ 'DifferentialRevisionFerretEngine' => 'applications/differential/search/DifferentialRevisionFerretEngine.php',
+ 'DifferentialRevisionFerretField' => 'applications/differential/storage/DifferentialRevisionFerretField.php',
+ 'DifferentialRevisionFerretNgrams' => 'applications/differential/storage/DifferentialRevisionFerretNgrams.php',
'DifferentialRevisionFulltextEngine' => 'applications/differential/search/DifferentialRevisionFulltextEngine.php',
'DifferentialRevisionGraph' => 'infrastructure/graph/DifferentialRevisionGraph.php',
'DifferentialRevisionHasChildRelationship' => 'applications/differential/relationships/DifferentialRevisionHasChildRelationship.php',
@@ -5522,6 +5526,7 @@
'PhabricatorDestructibleInterface',
'PhabricatorProjectInterface',
'PhabricatorFulltextInterface',
+ 'PhabricatorFerretInterface',
'PhabricatorConduitResultInterface',
'PhabricatorDraftInterface',
),
@@ -5545,6 +5550,10 @@
'DifferentialRevisionEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'DifferentialRevisionEditController' => 'DifferentialController',
'DifferentialRevisionEditEngine' => 'PhabricatorEditEngine',
+ 'DifferentialRevisionFerretDocument' => 'PhabricatorFerretDocument',
+ 'DifferentialRevisionFerretEngine' => 'PhabricatorFerretEngine',
+ 'DifferentialRevisionFerretField' => 'PhabricatorFerretField',
+ 'DifferentialRevisionFerretNgrams' => 'PhabricatorFerretNgrams',
'DifferentialRevisionFulltextEngine' => 'PhabricatorFulltextEngine',
'DifferentialRevisionGraph' => 'PhabricatorObjectGraph',
'DifferentialRevisionHasChildRelationship' => 'DifferentialRevisionRelationship',
diff --git a/src/applications/differential/search/DifferentialRevisionFerretEngine.php b/src/applications/differential/search/DifferentialRevisionFerretEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/differential/search/DifferentialRevisionFerretEngine.php
@@ -0,0 +1,26 @@
+<?php
+
+final class DifferentialRevisionFerretEngine
+ extends PhabricatorFerretEngine {
+
+ public function newNgramsObject() {
+ return new DifferentialRevisionFerretNgrams();
+ }
+
+ public function newDocumentObject() {
+ return new DifferentialRevisionFerretDocument();
+ }
+
+ public function newFieldObject() {
+ return new DifferentialRevisionFerretField();
+ }
+
+ protected function getFunctionMap() {
+ $map = parent::getFunctionMap();
+
+ $map['body']['aliases'][] = 'summary';
+
+ return $map;
+ }
+
+}
diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php
--- a/src/applications/differential/storage/DifferentialRevision.php
+++ b/src/applications/differential/storage/DifferentialRevision.php
@@ -15,6 +15,7 @@
PhabricatorDestructibleInterface,
PhabricatorProjectInterface,
PhabricatorFulltextInterface,
+ PhabricatorFerretInterface,
PhabricatorConduitResultInterface,
PhabricatorDraftInterface {
@@ -900,6 +901,14 @@
}
+/* -( PhabricatorFerretInterface )----------------------------------------- */
+
+
+ public function newFerretEngine() {
+ return new DifferentialRevisionFerretEngine();
+ }
+
+
/* -( PhabricatorConduitResultInterface )---------------------------------- */
diff --git a/src/applications/differential/storage/DifferentialRevisionFerretDocument.php b/src/applications/differential/storage/DifferentialRevisionFerretDocument.php
new file mode 100644
--- /dev/null
+++ b/src/applications/differential/storage/DifferentialRevisionFerretDocument.php
@@ -0,0 +1,14 @@
+<?php
+
+final class DifferentialRevisionFerretDocument
+ extends PhabricatorFerretDocument {
+
+ public function getApplicationName() {
+ return 'differential';
+ }
+
+ public function getIndexKey() {
+ return 'revision';
+ }
+
+}
diff --git a/src/applications/differential/storage/DifferentialRevisionFerretField.php b/src/applications/differential/storage/DifferentialRevisionFerretField.php
new file mode 100644
--- /dev/null
+++ b/src/applications/differential/storage/DifferentialRevisionFerretField.php
@@ -0,0 +1,14 @@
+<?php
+
+final class DifferentialRevisionFerretField
+ extends PhabricatorFerretField {
+
+ public function getApplicationName() {
+ return 'differential';
+ }
+
+ public function getIndexKey() {
+ return 'revision';
+ }
+
+}
diff --git a/src/applications/differential/storage/DifferentialRevisionFerretNgrams.php b/src/applications/differential/storage/DifferentialRevisionFerretNgrams.php
new file mode 100644
--- /dev/null
+++ b/src/applications/differential/storage/DifferentialRevisionFerretNgrams.php
@@ -0,0 +1,14 @@
+<?php
+
+final class DifferentialRevisionFerretNgrams
+ extends PhabricatorFerretNgrams {
+
+ public function getApplicationName() {
+ return 'differential';
+ }
+
+ public function getIndexKey() {
+ return 'revision';
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 5:16 PM (5 m, 1 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6908147
Default Alt Text
D18540.id.diff (7 KB)

Event Timeline