public function addTerm(Zend_Search_Lucene_Index_Term $term, $position = null) 
    {
        if ((count($this->_terms) != 0)&&(end($this->_terms)->field != $term->field)) {
            include_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception(
                'All phrase terms must be in the same field: ' .
                $term->field . ':' . $term->text
            );
        }

        $this->_terms[] = $term;
        if ($position !== null) {
            $this->_offsets[] = $position;
        } else if (count($this->_offsets) != 0) {
            $this->_offsets[] = end($this->_offsets) + 1;
        } else {
            $this->_offsets[] = 0;
        }
    }