setMaxExpansions() public method

Set max expansions.
public setMaxExpansions ( integer $maxExpansions )
$maxExpansions integer
Ejemplo n.º 1
0
 /**
  * @group functional
  */
 public function testFuzzyWithOptions2()
 {
     // Here with a 'M' search we should hit 'Moraes' first
     // and then stop because MaxExpansion = 1.
     // If MaxExpansion was set to 2, we could hit "Maindron" too.
     $multiMatch = new MultiMatch();
     $multiMatch->setQuery('M');
     $multiMatch->setFields(array('name'));
     $multiMatch->setType(MultiMatch::TYPE_PHRASE_PREFIX);
     $multiMatch->setPrefixLength(0);
     $multiMatch->setMaxExpansions(1);
     $resultSet = $this->_getResults($multiMatch);
     $this->assertEquals(1, $resultSet->count());
 }