setAnalyzer() public method

Set analyzer.
public setAnalyzer ( string $analyzer )
$analyzer string
コード例 #1
0
ファイル: MultiMatchTest.php プロジェクト: bungkoko/Elastica
 /**
  * @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());
 }