server=new \SphinxClient(); $this->server->SetServer($host,$port); } public static function instance($is_pre = false) { $key = $is_pre ? 'pre' : 'formal'; if (!isset(self::$instance[$key])) { $instance = new self($is_pre); self::$instance[$key] = $instance; } else { $instance = self::$instance[$key]; } return $instance; } public function query($keyword,$offset,$count,$max=1000){ $this->server->SetLimits ( $offset, $count, $max, 0 ); $res=$this->server->Query($keyword); return$res; } }