在Doctrine 2中使用注释添加FULLTEXT索引? [英] Add a FULLTEXT index in Doctrine 2 using annotations?
问题描述
有没有办法使用注释添加索引?似乎 @Index
注释没有指定类型...
根据 DDC-3014 在Doctrine的问题追踪器中,指定的可能性使用注释的全文索引于4月14日实施,将在2.5版中提供。如果您不喜欢等待,您可以尝试使用不稳定的开发版本或后端提交
这是一个使用示例:
/ **
* @Entity
* @Table(indexes = {@ Index(columns = {content},flags = {fulltext})})
* /
class评论
{
/ **
* @Column(type =text)
* /
private $ content;
...
}
I know that Doctrine 2 doesn't support FULLTEXT indexes. I'm actually using a result set mapping and native queries to FULLTEXT search innodb tables (MySQL 5.6). But I still need to mark one or more entity fields as part of the index.
Is there any way to add the index using annotations? It seems that @Index
annotation doesn't specify the type of...
According to DDC-3014 in the issue tracker of Doctrine, the possibility to specify full-text indices using annotations was implemented on April 14 and will be available in release 2.5. If you don't like to wait, you could try to use the unstable, development version or to backport the commit implementing the feature.
Here is a usage example:
/**
* @Entity
* @Table(indexes={@Index(columns={"content"}, flags={"fulltext"})})
*/
class Comment
{
/**
* @Column(type="text")
*/
private $content;
...
}
这篇关于在Doctrine 2中使用注释添加FULLTEXT索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!