public function addQuerySyntaxLexeme()
    {
        $lexeme = $this->_queryString[$this->_queryStringPosition];

        // Process two char lexemes
        if (strpos(self::QUERY_DOUBLECHARLEXEME_CHARS, $lexeme) !== false) {
            // increase current position in a query string
            $this->_queryStringPosition++;

            // check,
            if ($this->_queryStringPosition == count($this->_queryString)  
                || $this->_queryString[$this->_queryStringPosition] != $lexeme
            ) {
                    include_once 'Zend/Search/Lucene/Search/QueryParserException.php';
                    throw new Zend_Search_Lucene_Search_QueryParserException('Two chars lexeme expected. ' . $this->_positionMsg());
            }

            // duplicate character
            $lexeme .= $lexeme;
        }

        $token = new Zend_Search_Lucene_Search_QueryToken(
            Zend_Search_Lucene_Search_QueryToken::TC_SYNTAX_ELEMENT,
            $lexeme,
            $this->_queryStringPosition
        );

        // Skip this lexeme if it's a field indicator ':' and treat previous as 'field' instead of 'word'
        if ($token->type == Zend_Search_Lucene_Search_QueryToken::TT_FIELD_INDICATOR) {
            $token = array_pop($this->_lexemes);
            if ($token === null  ||  $token->type != Zend_Search_Lucene_Search_QueryToken::TT_WORD) {
                include_once 'Zend/Search/Lucene/Search/QueryParserException.php';
                throw new Zend_Search_Lucene_Search_QueryParserException('Field mark \':\' must follow field name. ' . $this->_positionMsg());
            }

            $token->type = Zend_Search_Lucene_Search_QueryToken::TT_FIELD;
        }

        $this->_lexemes[] = $token;
    }
public function addQuerySyntaxLexeme()
    {
        $lexeme = $this->_queryString[$this->_queryStringPosition];

        // Process two char lexemes
        if (strpos(self::QUERY_DOUBLECHARLEXEME_CHARS, $lexeme) !== false) {
            // increase current position in a query string
            $this->_queryStringPosition++;

            // check,
            if ($this->_queryStringPosition == count($this->_queryString)  
                || $this->_queryString[$this->_queryStringPosition] != $lexeme
            ) {
                    include_once 'Zend/Search/Lucene/Search/QueryParserException.php';
                    throw new Zend_Search_Lucene_Search_QueryParserException('Two chars lexeme expected. ' . $this->_positionMsg());
            }

            // duplicate character
            $lexeme .= $lexeme;
        }

        $token = new Zend_Search_Lucene_Search_QueryToken(
            Zend_Search_Lucene_Search_QueryToken::TC_SYNTAX_ELEMENT,
            $lexeme,
            $this->_queryStringPosition
        );

        // Skip this lexeme if it's a field indicator ':' and treat previous as 'field' instead of 'word'
        if ($token->type == Zend_Search_Lucene_Search_QueryToken::TT_FIELD_INDICATOR) {
            $token = array_pop($this->_lexemes);
            if ($token === null  ||  $token->type != Zend_Search_Lucene_Search_QueryToken::TT_WORD) {
                include_once 'Zend/Search/Lucene/Search/QueryParserException.php';
                throw new Zend_Search_Lucene_Search_QueryParserException('Field mark \':\' must follow field name. ' . $this->_positionMsg());
            }

            $token->type = Zend_Search_Lucene_Search_QueryToken::TT_FIELD;
        }

        $this->_lexemes[] = $token;
    }
public function addQuerySyntaxLexeme ( ) { $ lexeme = $ this -> _queryString [ $ this -> _queryStringPosition ] ; // Process two char lexemes if ( strpos ( self :: QUERY_DOUBLECHARLEXEME_CHARS , $ lexeme ) !== false ) { // increase current position in a query string $ this -> _queryStringPosition ++ ; // check, if ( $ this -> _queryStringPosition == count ( $ this -> _queryString ) || $ this -> _queryString [ $ this -> _queryStringPosition ] != $ lexeme ) { include_once 'Zend/Search/Lucene/Search/QueryParserException.php' ; throw new Zend_Search_Lucene_Search_QueryParserException ( 'Two chars lexeme expected. ' . $ this -> _positionMsg ( ) ) ; } // duplicate character $ lexeme .= $ lexeme ; } $ token = new Zend_Search_Lucene_Search_QueryToken ( Zend_Search_Lucene_Search_QueryToken :: TC_SYNTAX_ELEMENT , $ lexeme , $ this -> _queryStringPosition ) ; // Skip this lexeme if it's a field indicator ':' and treat previous as 'field' instead of 'word' if ( $ token -> type == Zend_Search_Lucene_Search_QueryToken :: TT_FIELD_INDICATOR ) { $ token = array_pop ( $ this -> _lexemes ) ; if ( $ token === null || $ token -> type != Zend_Search_Lucene_Search_QueryToken :: TT_WORD ) { include_once 'Zend/Search/Lucene/Search/QueryParserException.php' ; throw new Zend_Search_Lucene_Search_QueryParserException ( 'Field mark \':\' must follow field name. ' . $ this -> _positionMsg ( ) ) ; } $ token -> type = Zend_Search_Lucene_Search_QueryToken :: TT_FIELD ; } $ this -> _lexemes [ ] = $ token ; }
Add query syntax lexeme

@throws Zend_Search_Lucene_Search_QueryParserException
Add query syntax lexeme