예제 #1
0
파일: DisMax.php 프로젝트: lhess/solarium
 /**
  * Add request settings for Dismax
  *
  * @param  DismaxComponent $component
  * @param  Request         $request
  * @return Request
  */
 public function buildComponent($component, $request)
 {
     // enable dismax
     $request->addParam('defType', $component->getQueryParser());
     $request->addParam('q.alt', $component->getQueryAlternative());
     $request->addParam('qf', $component->getQueryFields());
     $request->addParam('mm', $component->getMinimumMatch());
     $request->addParam('pf', $component->getPhraseFields());
     $request->addParam('ps', $component->getPhraseSlop());
     $request->addParam('qs', $component->getQueryPhraseSlop());
     $request->addParam('tie', $component->getTie());
     $request->addParam('bq', $component->getBoostQuery());
     $request->addParam('bf', $component->getBoostFunctions());
     return $request;
 }
예제 #2
0
 /**
  * Add request settings for Dismax.
  *
  * @param DismaxComponent $component
  * @param Request         $request
  *
  * @return Request
  */
 public function buildComponent($component, $request)
 {
     // enable dismax
     $request->addParam('defType', $component->getQueryParser());
     $request->addParam('q.alt', $component->getQueryAlternative());
     $request->addParam('qf', $component->getQueryFields());
     $request->addParam('mm', $component->getMinimumMatch());
     $request->addParam('pf', $component->getPhraseFields());
     $request->addParam('ps', $component->getPhraseSlop());
     $request->addParam('qs', $component->getQueryPhraseSlop());
     $request->addParam('tie', $component->getTie());
     // add boostqueries to request
     $boostQueries = $component->getBoostQueries();
     if (count($boostQueries) !== 0) {
         foreach ($boostQueries as $boostQuery) {
             $request->addParam('bq', $boostQuery->getQuery());
         }
     }
     $request->addParam('bf', $component->getBoostFunctions());
     return $request;
 }