mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +01:00
Support Ferret engine in Pholio
Summary: Ref T12819. Support for Pholio. Test Plan: Indexed and searched mocks. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12819 Differential Revision: https://secure.phabricator.com/D18569
This commit is contained in:
parent
e0f3de9c64
commit
d8132db75b
6 changed files with 52 additions and 1 deletions
|
@ -0,0 +1,9 @@
|
|||
CREATE TABLE {$NAMESPACE}_pholio.pholio_mock_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};
|
|
@ -0,0 +1,8 @@
|
|||
CREATE TABLE {$NAMESPACE}_pholio.pholio_mock_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};
|
|
@ -0,0 +1,5 @@
|
|||
CREATE TABLE {$NAMESPACE}_pholio.pholio_mock_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};
|
|
@ -4475,6 +4475,7 @@ phutil_register_library_map(array(
|
|||
'PholioMockEditController' => 'applications/pholio/controller/PholioMockEditController.php',
|
||||
'PholioMockEditor' => 'applications/pholio/editor/PholioMockEditor.php',
|
||||
'PholioMockEmbedView' => 'applications/pholio/view/PholioMockEmbedView.php',
|
||||
'PholioMockFerretEngine' => 'applications/pholio/search/PholioMockFerretEngine.php',
|
||||
'PholioMockFulltextEngine' => 'applications/pholio/search/PholioMockFulltextEngine.php',
|
||||
'PholioMockHasTaskEdgeType' => 'applications/pholio/edge/PholioMockHasTaskEdgeType.php',
|
||||
'PholioMockHasTaskRelationship' => 'applications/pholio/relationships/PholioMockHasTaskRelationship.php',
|
||||
|
@ -10145,6 +10146,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSpacesInterface',
|
||||
'PhabricatorMentionableInterface',
|
||||
'PhabricatorFulltextInterface',
|
||||
'PhabricatorFerretInterface',
|
||||
),
|
||||
'PholioMockArchiveController' => 'PholioController',
|
||||
'PholioMockAuthorHeraldField' => 'PholioMockHeraldField',
|
||||
|
@ -10154,6 +10156,7 @@ phutil_register_library_map(array(
|
|||
'PholioMockEditController' => 'PholioController',
|
||||
'PholioMockEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PholioMockEmbedView' => 'AphrontView',
|
||||
'PholioMockFerretEngine' => 'PhabricatorFerretEngine',
|
||||
'PholioMockFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||
'PholioMockHasTaskEdgeType' => 'PhabricatorEdgeType',
|
||||
'PholioMockHasTaskRelationship' => 'PholioMockRelationship',
|
||||
|
|
18
src/applications/pholio/search/PholioMockFerretEngine.php
Normal file
18
src/applications/pholio/search/PholioMockFerretEngine.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
final class PholioMockFerretEngine
|
||||
extends PhabricatorFerretEngine {
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'pholio';
|
||||
}
|
||||
|
||||
public function getScopeName() {
|
||||
return 'mock';
|
||||
}
|
||||
|
||||
public function newSearchEngine() {
|
||||
return new PholioMockSearchEngine();
|
||||
}
|
||||
|
||||
}
|
|
@ -12,7 +12,8 @@ final class PholioMock extends PholioDAO
|
|||
PhabricatorDestructibleInterface,
|
||||
PhabricatorSpacesInterface,
|
||||
PhabricatorMentionableInterface,
|
||||
PhabricatorFulltextInterface {
|
||||
PhabricatorFulltextInterface,
|
||||
PhabricatorFerretInterface {
|
||||
|
||||
const MARKUP_FIELD_DESCRIPTION = 'markup:description';
|
||||
|
||||
|
@ -320,4 +321,11 @@ final class PholioMock extends PholioDAO
|
|||
}
|
||||
|
||||
|
||||
/* -( PhabricatorFerretInterface )----------------------------------------- */
|
||||
|
||||
public function newFerretEngine() {
|
||||
return new PholioMockFerretEngine();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue