protected function _createTerm( $name, $type, $value )
	{
		switch( $this->getOperator() )
		{
			case '==':

				$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $value );
				$term = new Zend_Search_Lucene_Index_Term( $this->_empty( $escaped ), $name );

				return new Zend_Search_Lucene_Search_Query_Term( $term );

			case '!=':

				$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $value );
				$term = new Zend_Search_Lucene_Index_Term( $this->_empty( $escaped ), $name );

				return new Zend_Search_Lucene_Search_Query_MultiTerm( array( $term ), array( false ) );

			case '~=':

				if( ( $parts = explode( ' ', $value ) ) === false ) {
					throw new MW_Common_Exception( 'Empty term is not allowed for wildcard queries' );
				}

				$query = new Zend_Search_Lucene_Search_Query_Boolean();

				foreach( $parts as $part )
				{
					$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $part );
					$term = new Zend_Search_Lucene_Index_Term( strtolower( $this->_empty( $escaped ) ) . '*', $name );
					$query->addSubquery( new Zend_Search_Lucene_Search_Query_Wildcard( $term ) );
				}

				return $query;

			case '>=':
			case '>':

				$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $value );
				$term = new Zend_Search_Lucene_Index_Term( $this->_empty( $escaped ), $name );
				$inclusive = self::$_operators[$this->getOperator()];

				return new Zend_Search_Lucene_Search_Query_Range( $term, null, $inclusive );

			case '<=':
			case '<':

				$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $value );
				$term = new Zend_Search_Lucene_Index_Term( $this->_empty( $escaped ), $name );
				$inclusive = self::$_operators[$this->getOperator()];

				return new Zend_Search_Lucene_Search_Query_Range( null, $term, $inclusive );
		}
	}
protected function _createTerm( $name, $type, $value )
	{
		switch( $this->getOperator() )
		{
			case '==':

				$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $value );
				$term = new Zend_Search_Lucene_Index_Term( $this->_empty( $escaped ), $name );

				return new Zend_Search_Lucene_Search_Query_Term( $term );

			case '!=':

				$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $value );
				$term = new Zend_Search_Lucene_Index_Term( $this->_empty( $escaped ), $name );

				return new Zend_Search_Lucene_Search_Query_MultiTerm( array( $term ), array( false ) );

			case '~=':

				if( ( $parts = explode( ' ', $value ) ) === false ) {
					throw new MW_Common_Exception( 'Empty term is not allowed for wildcard queries' );
				}

				$query = new Zend_Search_Lucene_Search_Query_Boolean();

				foreach( $parts as $part )
				{
					$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $part );
					$term = new Zend_Search_Lucene_Index_Term( strtolower( $this->_empty( $escaped ) ) . '*', $name );
					$query->addSubquery( new Zend_Search_Lucene_Search_Query_Wildcard( $term ) );
				}

				return $query;

			case '>=':
			case '>':

				$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $value );
				$term = new Zend_Search_Lucene_Index_Term( $this->_empty( $escaped ), $name );
				$inclusive = self::$_operators[$this->getOperator()];

				return new Zend_Search_Lucene_Search_Query_Range( $term, null, $inclusive );

			case '<=':
			case '<':

				$escaped = $this->_escape( $this->getOperator(), SORT_STRING, $value );
				$term = new Zend_Search_Lucene_Index_Term( $this->_empty( $escaped ), $name );
				$inclusive = self::$_operators[$this->getOperator()];

				return new Zend_Search_Lucene_Search_Query_Range( null, $term, $inclusive );
		}
	}
protected function _createTerm ( $ name , $ type , $ value ) { switch ( $ this -> getOperator ( ) ) { case '==' : $ escaped = $ this -> _escape ( $ this -> getOperator ( ) , SORT_STRING , $ value ) ; $ term = new Zend_Search_Lucene_Index_Term ( $ this -> _empty ( $ escaped ) , $ name ) ; return new Zend_Search_Lucene_Search_Query_Term ( $ term ) ; case '!=' : $ escaped = $ this -> _escape ( $ this -> getOperator ( ) , SORT_STRING , $ value ) ; $ term = new Zend_Search_Lucene_Index_Term ( $ this -> _empty ( $ escaped ) , $ name ) ; return new Zend_Search_Lucene_Search_Query_MultiTerm ( array ( $ term ) , array ( false ) ) ; case '~=' : if ( ( $ parts = explode ( ' ' , $ value ) ) === false ) { throw new MW_Common_Exception ( 'Empty term is not allowed for wildcard queries' ) ; } $ query = new Zend_Search_Lucene_Search_Query_Boolean ( ) ; foreach ( $ parts as $ part ) { $ escaped = $ this -> _escape ( $ this -> getOperator ( ) , SORT_STRING , $ part ) ; $ term = new Zend_Search_Lucene_Index_Term ( strtolower ( $ this -> _empty ( $ escaped ) ) . '*' , $ name ) ; $ query -> addSubquery ( new Zend_Search_Lucene_Search_Query_Wildcard ( $ term ) ) ; } return $ query ; case '>=' : case '>' : $ escaped = $ this -> _escape ( $ this -> getOperator ( ) , SORT_STRING , $ value ) ; $ term = new Zend_Search_Lucene_Index_Term ( $ this -> _empty ( $ escaped ) , $ name ) ; $ inclusive = self :: $ _operators [ $ this -> getOperator ( ) ] ; return new Zend_Search_Lucene_Search_Query_Range ( $ term , null , $ inclusive ) ; case '<=' : case '<' : $ escaped = $ this -> _escape ( $ this -> getOperator ( ) , SORT_STRING , $ value ) ; $ term = new Zend_Search_Lucene_Index_Term ( $ this -> _empty ( $ escaped ) , $ name ) ; $ inclusive = self :: $ _operators [ $ this -> getOperator ( ) ] ; return new Zend_Search_Lucene_Search_Query_Range ( null , $ term , $ inclusive ) ; } }
Creates a Lucene query object from the given parameters.

@param string $name Translated name of variable that should be compared
@param integer $type Type constant
@param mixed $value Value that the variable should be compared to
@return Zend_Search_Lucene_Search_Query Lucene query object
Creates a Lucene query object from the given parameters .