mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-24 21:48:21 +01:00
Support Ferret engine in Fund initiatives
Summary: Ref T12819. Adds Ferret engine support to initiatives. Test Plan: Indexed and searched for initiatives. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12819 Differential Revision: https://secure.phabricator.com/D18555
This commit is contained in:
parent
cf0bc32e18
commit
f23717b416
10 changed files with 113 additions and 5 deletions
|
@ -0,0 +1,9 @@
|
||||||
|
CREATE TABLE {$NAMESPACE}_fund.fund_initiative_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}_fund.fund_initiative_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}_fund.fund_initiative_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};
|
|
@ -1153,6 +1153,10 @@ phutil_register_library_map(array(
|
||||||
'FundInitiativeEditController' => 'applications/fund/controller/FundInitiativeEditController.php',
|
'FundInitiativeEditController' => 'applications/fund/controller/FundInitiativeEditController.php',
|
||||||
'FundInitiativeEditEngine' => 'applications/fund/editor/FundInitiativeEditEngine.php',
|
'FundInitiativeEditEngine' => 'applications/fund/editor/FundInitiativeEditEngine.php',
|
||||||
'FundInitiativeEditor' => 'applications/fund/editor/FundInitiativeEditor.php',
|
'FundInitiativeEditor' => 'applications/fund/editor/FundInitiativeEditor.php',
|
||||||
|
'FundInitiativeFerretDocument' => 'applications/fund/storage/FundInitiativeFerretDocument.php',
|
||||||
|
'FundInitiativeFerretEngine' => 'applications/fund/search/FundInitiativeFerretEngine.php',
|
||||||
|
'FundInitiativeFerretField' => 'applications/fund/storage/FundInitiativeFerretField.php',
|
||||||
|
'FundInitiativeFerretNgrams' => 'applications/fund/storage/FundInitiativeFerretNgrams.php',
|
||||||
'FundInitiativeFulltextEngine' => 'applications/fund/search/FundInitiativeFulltextEngine.php',
|
'FundInitiativeFulltextEngine' => 'applications/fund/search/FundInitiativeFulltextEngine.php',
|
||||||
'FundInitiativeListController' => 'applications/fund/controller/FundInitiativeListController.php',
|
'FundInitiativeListController' => 'applications/fund/controller/FundInitiativeListController.php',
|
||||||
'FundInitiativeMerchantTransaction' => 'applications/fund/xaction/FundInitiativeMerchantTransaction.php',
|
'FundInitiativeMerchantTransaction' => 'applications/fund/xaction/FundInitiativeMerchantTransaction.php',
|
||||||
|
@ -6231,6 +6235,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorTokenReceiverInterface',
|
'PhabricatorTokenReceiverInterface',
|
||||||
'PhabricatorDestructibleInterface',
|
'PhabricatorDestructibleInterface',
|
||||||
'PhabricatorFulltextInterface',
|
'PhabricatorFulltextInterface',
|
||||||
|
'PhabricatorFerretInterface',
|
||||||
),
|
),
|
||||||
'FundInitiativeBackController' => 'FundController',
|
'FundInitiativeBackController' => 'FundController',
|
||||||
'FundInitiativeBackerTransaction' => 'FundInitiativeTransactionType',
|
'FundInitiativeBackerTransaction' => 'FundInitiativeTransactionType',
|
||||||
|
@ -6239,6 +6244,10 @@ phutil_register_library_map(array(
|
||||||
'FundInitiativeEditController' => 'FundController',
|
'FundInitiativeEditController' => 'FundController',
|
||||||
'FundInitiativeEditEngine' => 'PhabricatorEditEngine',
|
'FundInitiativeEditEngine' => 'PhabricatorEditEngine',
|
||||||
'FundInitiativeEditor' => 'PhabricatorApplicationTransactionEditor',
|
'FundInitiativeEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||||
|
'FundInitiativeFerretDocument' => 'PhabricatorFerretDocument',
|
||||||
|
'FundInitiativeFerretEngine' => 'PhabricatorFerretEngine',
|
||||||
|
'FundInitiativeFerretField' => 'PhabricatorFerretField',
|
||||||
|
'FundInitiativeFerretNgrams' => 'PhabricatorFerretNgrams',
|
||||||
'FundInitiativeFulltextEngine' => 'PhabricatorFulltextEngine',
|
'FundInitiativeFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||||
'FundInitiativeListController' => 'FundController',
|
'FundInitiativeListController' => 'FundController',
|
||||||
'FundInitiativeMerchantTransaction' => 'FundInitiativeTransactionType',
|
'FundInitiativeMerchantTransaction' => 'FundInitiativeTransactionType',
|
||||||
|
|
|
@ -42,28 +42,28 @@ final class FundInitiativeQuery
|
||||||
if ($this->ids !== null) {
|
if ($this->ids !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn,
|
$conn,
|
||||||
'id IN (%Ld)',
|
'i.id IN (%Ld)',
|
||||||
$this->ids);
|
$this->ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->phids !== null) {
|
if ($this->phids !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn,
|
$conn,
|
||||||
'phid IN (%Ls)',
|
'i.phid IN (%Ls)',
|
||||||
$this->phids);
|
$this->phids);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->ownerPHIDs !== null) {
|
if ($this->ownerPHIDs !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn,
|
$conn,
|
||||||
'ownerPHID IN (%Ls)',
|
'i.ownerPHID IN (%Ls)',
|
||||||
$this->ownerPHIDs);
|
$this->ownerPHIDs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->statuses !== null) {
|
if ($this->statuses !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn,
|
$conn,
|
||||||
'status IN (%Ls)',
|
'i.status IN (%Ls)',
|
||||||
$this->statuses);
|
$this->statuses);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,4 +74,8 @@ final class FundInitiativeQuery
|
||||||
return 'PhabricatorFundApplication';
|
return 'PhabricatorFundApplication';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getPrimaryTableAlias() {
|
||||||
|
return 'i';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
22
src/applications/fund/search/FundInitiativeFerretEngine.php
Normal file
22
src/applications/fund/search/FundInitiativeFerretEngine.php
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class FundInitiativeFerretEngine
|
||||||
|
extends PhabricatorFerretEngine {
|
||||||
|
|
||||||
|
public function newNgramsObject() {
|
||||||
|
return new FundInitiativeFerretNgrams();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function newDocumentObject() {
|
||||||
|
return new FundInitiativeFerretDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function newFieldObject() {
|
||||||
|
return new FundInitiativeFerretField();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function newSearchEngine() {
|
||||||
|
return new FundInitiativeSearchEngine();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -10,7 +10,8 @@ final class FundInitiative extends FundDAO
|
||||||
PhabricatorFlaggableInterface,
|
PhabricatorFlaggableInterface,
|
||||||
PhabricatorTokenReceiverInterface,
|
PhabricatorTokenReceiverInterface,
|
||||||
PhabricatorDestructibleInterface,
|
PhabricatorDestructibleInterface,
|
||||||
PhabricatorFulltextInterface {
|
PhabricatorFulltextInterface,
|
||||||
|
PhabricatorFerretInterface {
|
||||||
|
|
||||||
protected $name;
|
protected $name;
|
||||||
protected $ownerPHID;
|
protected $ownerPHID;
|
||||||
|
@ -212,4 +213,12 @@ final class FundInitiative extends FundDAO
|
||||||
return new FundInitiativeFulltextEngine();
|
return new FundInitiativeFulltextEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -( PhabricatorFerretInterface )----------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
public function newFerretEngine() {
|
||||||
|
return new FundInitiativeFerretEngine();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class FundInitiativeFerretDocument
|
||||||
|
extends PhabricatorFerretDocument {
|
||||||
|
|
||||||
|
public function getApplicationName() {
|
||||||
|
return 'fund';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIndexKey() {
|
||||||
|
return 'initiative';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
14
src/applications/fund/storage/FundInitiativeFerretField.php
Normal file
14
src/applications/fund/storage/FundInitiativeFerretField.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class FundInitiativeFerretField
|
||||||
|
extends PhabricatorFerretField {
|
||||||
|
|
||||||
|
public function getApplicationName() {
|
||||||
|
return 'fund';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIndexKey() {
|
||||||
|
return 'initiative';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
14
src/applications/fund/storage/FundInitiativeFerretNgrams.php
Normal file
14
src/applications/fund/storage/FundInitiativeFerretNgrams.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class FundInitiativeFerretNgrams
|
||||||
|
extends PhabricatorFerretNgrams {
|
||||||
|
|
||||||
|
public function getApplicationName() {
|
||||||
|
return 'fund';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIndexKey() {
|
||||||
|
return 'initiative';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue