我試圖用Doctrine 1.2的搜索行爲爲我的項目構建一個搜索引擎,我遵循手冊的recomandation並構建了一個YAML並引用了我的搜索字段。 並調用generateModelsFromYaml函數來創建我的PHP模型,所有的PHP型號都沒有錯誤,但創建搜索索引表的模型缺少...不是generateModelsFromYaml()生成的學說搜索索引模型
我YAML文件的摘錄:
DIFFichier:
tableName: ens_diffusion.DIF_Fichiers
columns:
DOC_Id:
type: integer(4)
primary: true
notnull: true
autoincrement: true
DOC_Categorie:
type: integer(4)
default: 0
DOC_Description:
type: string(256)
DOC_Adresse:
type: string(256)
options:
charset: utf8
type: InnoDB
actAs:
Searchable:
fields: [DOC_Description]
的seachable字段在模型中產生的,在這裏我正確生成一個名爲「DIFFichier」的模式,但相應的索引表「d_i_f_fichier_index」缺少
$searchable0 = new Doctrine_Template_Searchable(array(
'fields' =>
array(
0 => 'DOC_Description',
),
));
$this->actAs($searchable0);
我產生我的PHP模型這樣
include_once "Doctrine-1.2.3/Doctrine.php";
spl_autoload_register(array('Doctrine', 'autoload'));
Doctrine::generateModelsFromYaml(
'diffusion2.yml',
'C:\Documents and Settings\admin\Desktop\modelsDoctrine',
array(
'doctrine'
),
array(
'classPrefix' => 'Diffusion_Model_',
'classPrefixFiles' => false
)
);
我仍然無法生成我的索引表,是否有其他方式從我的YAML文件生成我的表?