_phrase = $phrase; $this->_field = $field; } /** * Process modifier ('~') * * @param mixed $parameter */ public function processFuzzyProximityModifier($parameter = null) { $this->_proximityQuery = true; if ($parameter !== null) { $this->_wordsDistance = $parameter; } } /** * Transform entry to a subquery * * @param string $encoding * @return Zend_Search_Lucene_Search_Query * @throws Zend_Search_Lucene_Search_QueryParserException */ public function getQuery($encoding) { /** Zend_Search_Lucene_Search_Query_Preprocessing_Phrase */ #require_once 'Zend/Search/Lucene/Search/Query/Preprocessing/Phrase.php'; $query = new Zend_Search_Lucene_Search_Query_Preprocessing_Phrase($this->_phrase, $encoding, ($this->_field !== null)? iconv($encoding, 'UTF-8', $this->_field) : null); if ($this->_proximityQuery) { $query->setSlop($this->_wordsDistance); } $query->setBoost($this->_boost); return $query; } }