private function searchBySphinx($request, $response, $kw, $p)
	{/*{{{*/
        $doctorSearchd = SphinxSearchdBase::createSearchdByType('Doctor');
        $utf8Kw = mb_convert_encoding($kw, 'utf-8', 'gbk');
		$res = $doctorSearchd->query($utf8Kw, ($p - 1) * 15, 15);
        $searchResult = SearchResult::sphinxResult2searchResult($res, 'doctor', ($p - 1) * 15, 15);
        $response->totalPage = ceil($searchResult->total_found/$searchResult->pageSize);
		
		$results = array();
		foreach($searchResult->items as $item)
		{/*{{{*/
			$doctor = DAL::get()->find('doctor',$item->id);
			
            if($doctor->isNull() || $doctor->deleted > 0 )
            {
				continue;
			}
			
			$result = array();
			$result['id'] = $doctor->id;
			$result['name'] = $doctor->name;
			$result['title'] = $doctor->title;
			$result['hospital'] = $doctor->hospitalfaculty->hospital->name;
			$result['userid'] = $doctor->getUserId();
			$result['hospitalfacultyname'] = $doctor->hospitalfaculty->name ;
			$results[] = (object)$result;
		}/*}}}*/
		return $results;
	}/*}}}*/
    /**
        * @brief 搜索订阅医生
        * @author lhl
        * @exampleUrl http://dev.mobile-api.haodf.com/patientapi/subscription_searchdoctor?keyword=吴鸣&pageId=1&pageSize=15&userId=581662815 
        *
        * @param $keyword 搜索字段 
        * @Param $pageId 当前页码
        * @Param $pageSize 每页显示数
        *
        * @return array('doctorid', 'name', 'fullGrade', 'hospitalName', 'hospitalFacultyName', 'goodVoteCount', 'specialize', 'logoUrl')
     */
    public function searchDoctor($userId, $keyword, $pageId = 1, $pageSize = 15)
	{/*{{{*/
        if($userId != $this->currentUserId)
        {
            $this->setErrorCode(309);
            return 0;
        }
        if('' == trim($keyword))
        {
            $this->setErrorCode(450);
            return 0;
        }
        $doctorSearchd = SphinxSearchdBase::createSearchdByType('Doctor');
        $utf8Kw = mb_convert_encoding($keyword, 'utf-8', 'gbk');
		$res = $doctorSearchd->query($utf8Kw, (int)(($pageId - 1 ) * $pageSize), (int)($pageSize));
        $searchResult = SearchResult::sphinxResult2searchResult($res, 'doctor', (int)(($pageId - 1 ) * $pageSize), (int)($pageSize));
		
		$myDoctorList = SubscriptionClient::getInstance()->getMyDoctors($userId);
        $subscriptionDoctor = array();
        foreach($myDoctorList as $myDoctor) 
        {
           $subscriptionDoctor[$myDoctor->doctor->id] = $myDoctor->id;
        }

		$results = array();
		foreach($searchResult->items as $item)
		{
			$doctor = DAL::get()->find('doctor',$item->id);
			
            if(false == $doctor->isNull() && $doctor->deleted == 0)
            {
                $result = $allHospitalFacultyNames = array();
                $result['doctorid'] = $doctor->id;
                $result['name'] = $doctor->name;
                $result['fullGrade'] = implode(" ",array($doctor->grade,$doctor->educateGrade));
                $primaryDoctors = DAL::get()->find_all_byPrimaryIds('Doctor', array($doctor->primaryId));
                foreach ($primaryDoctors as $primaryDoctor)
                {
                    $allHospitalFacultyNames[] = $primaryDoctor->hospitalfaculty->hospital->commonName.' '.$primaryDoctor->hospitalfaculty->name;
                }
                $result['hospitalName'] = implode("\n", $allHospitalFacultyNames);
                $result['hospitalFacultyName'] = '';
                $result['goodVoteCount'] = $doctor->goodVoteCount;
                $result['specialize'] = $doctor->specialize;
                $result['logoUrl'] = $doctor->getHeadImageForMobile();
                $result['mydoctorid'] = '';
                if(isset($subscriptionDoctor[$doctor->id]))
                {
                    $result['mydoctorid'] = $subscriptionDoctor[$doctor->id];
                }
                $results[] = $result;
            }
		}
        $this->content = $results;
        $this->pageInfo = array('pages' => ceil($searchResult->total_found / $searchResult->pageSize), 'pagesize' => $pageSize, 'nowpage' => $pageId, 'total' => $searchResult->total_found);
	}/*}}}*/