* @license http://github.com/basdenooijer/solarium/raw/master/COPYING * @link http://www.solarium-project.org/ * * @package Solarium * @subpackage Client */ /** * Add select component morelikethis to the request * * @package Solarium * @subpackage Client */ class Solarium_Client_RequestBuilder_Select_Component_MoreLikeThis { /** * Add request settings for morelikethis * * @param Solarium_Query_Select_Component_MoreLikeThis $component * @param Solarium_Client_Request $request * @return Solarium_Client_Request */ public function buildComponent($component, $request) { // enable morelikethis $request->addParam('mlt', 'true'); $request->addParam('mlt.fl', $component->getFields()); $request->addParam('mlt.mintf', $component->getMinimumTermFrequency()); $request->addParam('mlt.mindf', $component->getMinimumDocumentFrequency()); $request->addParam('mlt.minwl', $component->getMinimumWordLength()); $request->addParam('mlt.maxwl', $component->getMaximumWordLength()); $request->addParam('mlt.maxqt', $component->getMaximumQueryTerms()); $request->addParam('mlt.maxntp', $component->getMaximumNumberOfTokens()); $request->addParam('mlt.boost', $component->getBoost()); $request->addParam('mlt.qf', $component->getQueryFields()); $request->addParam('mlt.count', $component->getCount()); return $request; } }