public function addField(Zend_Search_Lucene_Field $field)
    {
        if (!isset($this->_fields[$field->name])) {
            $fieldNumber = count($this->_fields);
            $this->_fields[$field->name] =
                                new Zend_Search_Lucene_Index_FieldInfo(
                                    $field->name,
                                    $field->isIndexed,
                                    $fieldNumber,
                                    $field->storeTermVector
                                );

            return $fieldNumber;
        } else {
            $this->_fields[$field->name]->isIndexed       |= $field->isIndexed;
            $this->_fields[$field->name]->storeTermVector |= $field->storeTermVector;

            return $this->_fields[$field->name]->number;
        }
    }
public function addField(Zend_Search_Lucene_Field $field)
    {
        if (!isset($this->_fields[$field->name])) {
            $fieldNumber = count($this->_fields);
            $this->_fields[$field->name] =
                                new Zend_Search_Lucene_Index_FieldInfo(
                                    $field->name,
                                    $field->isIndexed,
                                    $fieldNumber,
                                    $field->storeTermVector
                                );

            return $fieldNumber;
        } else {
            $this->_fields[$field->name]->isIndexed       |= $field->isIndexed;
            $this->_fields[$field->name]->storeTermVector |= $field->storeTermVector;

            return $this->_fields[$field->name]->number;
        }
    }
public function addField ( Zend_Search_Lucene_Field $ field ) { if ( ! isset ( $ this -> _fields [ $ field -> name ] ) ) { $ fieldNumber = count ( $ this -> _fields ) ; $ this -> _fields [ $ field -> name ] = new Zend_Search_Lucene_Index_FieldInfo ( $ field -> name , $ field -> isIndexed , $ fieldNumber , $ field -> storeTermVector ) ; return $ fieldNumber ; } else { $ this -> _fields [ $ field -> name ] -> isIndexed |= $ field -> isIndexed ; $ this -> _fields [ $ field -> name ] -> storeTermVector |= $ field -> storeTermVector ; return $ this -> _fields [ $ field -> name ] -> number ; } }
Add field to the segment

Returns actual field number

@param  Zend_Search_Lucene_Field $field
@return integer
Add field to the segment