1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 15:52:41 +01:00
phorge-phorge/src/applications/maniphest/search/ManiphestTaskFerretEngine.php
epriestley 8059db894d Use the Ferret engine fulltext document table to drive auxiliary fulltext constraints
Summary:
Ref T12819. I started trying to get individual engines to drive these constraints (e.g., `ManiphestTaskQuery` can do most of the work) but this is a big pain, especially since most engines don't support "any owner" or "no owner", and not everything has an owner, and so on and so on. Going down this path would have meant a huge pile of stub functions everywhere, I think.

Instead, drive these through the main engine using the fulltext document table, which already has everything we need to apply these constraints in a uniform way.

Also tweak some parts of query construction and result ordering.

Test Plan: Searched for documents by author, owner, unowned, any owner, tags, subscribers, fulltext in global search. Got sensible results without any application-specific code.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12819

Differential Revision: https://secure.phabricator.com/D18550
2017-09-07 13:21:42 -07:00

31 lines
622 B
PHP

<?php
final class ManiphestTaskFerretEngine
extends PhabricatorFerretEngine {
public function newNgramsObject() {
return new ManiphestTaskFerretNgrams();
}
public function newDocumentObject() {
return new ManiphestTaskFerretDocument();
}
public function newFieldObject() {
return new ManiphestTaskFerretField();
}
public function newSearchEngine() {
return new ManiphestTaskSearchEngine();
}
protected function getFunctionMap() {
$map = parent::getFunctionMap();
$map['body']['aliases'][] = 'desc';
$map['body']['aliases'][] = 'description';
return $map;
}
}