setZeroTermsQuery() public méthode

If not set, default to 'none'
public setZeroTermsQuery ( string $zeroTermQuery = 'none' )
$zeroTermQuery string
Exemple #1
0
 /**
  * @group functional
  */
 public function testZeroTerm()
 {
     $multiMatch = new MultiMatch();
     $multiMatch->setQuery('not');
     // This is a stopword.
     $multiMatch->setFields(array('full_name', 'last_name'));
     $multiMatch->setZeroTermsQuery(MultiMatch::ZERO_TERM_NONE);
     $multiMatch->setAnalyzer('stops');
     $resultSet = $this->_getResults($multiMatch);
     $this->assertEquals(0, $resultSet->count());
     $multiMatch->setZeroTermsQuery(MultiMatch::ZERO_TERM_ALL);
     $resultSet = $this->_getResults($multiMatch);
     $this->assertEquals(4, $resultSet->count());
 }