Example #1
0
 public function buildIndex()
 {
     $links = Links::get();
     $keywords = Keywords::get();
     $titles = Titles::get();
     foreach ($links as $link) {
         SearchIndex::upsertToIndex($link);
     }
     foreach ($keywords as $keyword) {
         SearchIndex::upsertToIndex($keyword);
     }
     foreach ($titles as $title) {
         SearchIndex::upsertToIndex($title);
     }
     return 'indexed all links and keywords';
 }