php – 多个字段上的Doctrine全文

我有一个具有某些属性的实体,我想将其中的一些用于全文索引.

* @Index(name="search", columns={"description", "short_description", "name"}, flags={"fulltext"})})

现在,如果我使用MATCH(描述,short_description)执行查询,反对(…)我得到:

Can’t find FULLTEXT index matching the column list

如果我为全文索引只有一列:

 * @Index(columns={"description"}, flags={"fulltext"})})

然后尝试使用MATCH(描述)反对(…)一切正常.
那么我如何索引多列?

谢谢.

最佳答案 我找到了我的问题的解决方案,所以我发布给有同样问题的人.

我索引三列做:

* @Index(name="search", columns={"description", "short_description", "name"}, flags={"fulltext"})})

所以我必须在我的查询中使用所有这些:

MATCH(description, short_description, name) AGAINST (...)

我不能只匹配其中一些索引.
希望这有帮助.

点赞