3 final class ConpherenceThreadSearchController
4 extends ConpherenceController
{
6 public function shouldAllowPublic() {
10 public function handleRequest(AphrontRequest
$request) {
11 $viewer = $request->getViewer();
12 $conpherence_id = $request->getURIData('id');
13 $fulltext = $request->getStr('fulltext');
15 $conpherence = id(new ConpherenceThreadQuery())
17 ->withIDs(array($conpherence_id))
21 return new Aphront404Response();
24 $engine = new ConpherenceThreadSearchEngine();
25 $engine->setViewer($viewer);
26 $saved = $engine->buildSavedQueryFromBuiltin('all')
27 ->setParameter('phids', array($conpherence->getPHID()))
28 ->setParameter('fulltext', $fulltext);
30 $pager = $engine->newPagerForSavedQuery($saved);
31 $pager->setPageSize(15);
33 $query = $engine->buildQueryFromSavedQuery($saved);
35 $results = $engine->executeQuery($query, $pager);
36 $view = $engine->renderResults($results, $saved);
38 return id(new AphrontAjaxResponse())
39 ->setContent($view->getContent());