3
final class ConpherenceFulltextQuery
4
extends PhabricatorOffsetPagedQuery {
9
public function withThreadPHIDs(array $phids) {
10
$this->threadPHIDs = $phids;
14
public function withFulltext($fulltext) {
15
$this->fulltext = $fulltext;
19
public function execute() {
20
$table = new ConpherenceIndex();
21
$conn_r = $table->establishConnection('r');
25
'SELECT threadPHID, transactionPHID, previousTransactionPHID
27
$table->getTableName(),
28
$this->buildWhereClause($conn_r),
29
$this->buildOrderByClause($conn_r),
30
$this->buildLimitClause($conn_r));
35
private function buildWhereClause($conn_r) {
38
if ($this->threadPHIDs !== null) {
41
'i.threadPHID IN (%Ls)',
45
if (strlen($this->fulltext)) {
48
'MATCH(i.corpus) AGAINST (%s IN BOOLEAN MODE)',
52
return $this->formatWhereClause($where);
55
private function buildOrderByClause(AphrontDatabaseConnection $conn_r) {
56
if (strlen($this->fulltext)) {
59
'ORDER BY MATCH(i.corpus) AGAINST (%s IN BOOLEAN MODE) DESC',