Exemplo n.º 1
0
 /**
  * Add request settings for Spellcheck
  *
  * @param Solarium_Query_Select_Component_Spellcheck $component
  * @param Solarium_Client_Request $request
  * @return Solarium_Client_Request
  */
 public function buildComponent($component, $request)
 {
     // enable spellcheck
     $request->addParam('spellcheck', 'true');
     $request->addParam('spellcheck.q', $component->getQuery());
     $request->addParam('spellcheck.build', $component->getBuild());
     $request->addParam('spellcheck.reload', $component->getReload());
     $request->addParam('spellcheck.dictionary', $component->getDictionary());
     $request->addParam('spellcheck.count', $component->getCount());
     $request->addParam('spellcheck.onlyMorePopular', $component->getOnlyMorePopular());
     $request->addParam('spellcheck.extendedResults', $component->getExtendedResults());
     $request->addParam('spellcheck.collate', $component->getCollate());
     $request->addParam('spellcheck.maxCollations', $component->getMaxCollations());
     $request->addParam('spellcheck.maxCollationTries', $component->getMaxCollationTries());
     $request->addParam('spellcheck.maxCollationEvaluations', $component->getMaxCollationEvaluations());
     $request->addParam('spellcheck.collateExtendedResults', $component->getCollateExtendedResults());
     $request->addParam('spellcheck.accuracy', $component->getAccuracy());
     return $request;
 }
 public function testSetAndGetMaxCollationTries()
 {
     $value = 10;
     $this->_spellCheck->setMaxCollationTries($value);
     $this->assertEquals($value, $this->_spellCheck->getMaxCollationTries());
 }