【发布时间】:2011-06-15 10:47:00
【问题描述】:
我正在尝试使用 Doctrine 1.2 的搜索行为为我的项目构建一个搜索引擎,我按照手册的建议构建了一个 YAML,并引用了我的搜索字段。 并调用 generateModelsFromYaml 函数创建我的 php 模型,所有 php 模型都创建没有错误但搜索索引表的模型丢失了......
我的 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]
模型中生成了可搜索的字段,这里我正确生成了一个名为“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 文件生成我的表吗?
【问题讨论】: