예제 #1
0
 public function queryAction()
 {
     $indexer = new Search_Segment();
     $query = $indexer->queryOne();
     DebugTools::print_r($query);
     return false;
 }
예제 #2
0
 public function serverAction()
 {
     $server = new Jsonrpc_Server();
     $server->register('find', function ($keywords, $offset = 0, $limit = 12) {
         $segmenter = new Search_Segment();
         $matcher = new Search_Match('gamedb');
         $text = $segmenter->cutString('lol');
         $data = $matcher->call($text, 0, 12);
         foreach ($data['list'] as $k => $v) {
             $configer = new Search_Config($v->app);
             $data['list'][$k] = array('title' => $configer->formatTitle($v->table, $v, $text), 'detail' => $configer->formatDetail($v->table, $v, $text), 'url' => $configer->formatUrl($v->table, $v), 'image_url' => $configer->formatImage($v->table, $v));
         }
         $data['keyword'] = $text;
         return $data;
     });
     echo $server->execute();
 }