public function run() { $search = new Indexer(); $search->indexAll(); //print_r($search->searchCommon(array('title' => 'ubuntu', 'category' => 6))); }
/** * Finds related posts */ public function showRelatedAction() { $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); $post = Posts::findFirstById($this->request->getPost('id')); if ($post) { $indexer = new Indexer(); $posts = $indexer->search(['title' => $post->title, 'category' => $post->categories_id], 5, true); if (count($posts) == 0) { $posts = $indexer->search(['title' => $post->title], 5, true); } $this->view->setVar('posts', $posts); } else { $this->view->setVar('posts', []); } }
public function run() { $search = new Indexer(); $search->indexAll(); }