【发布时间】:2017-03-12 00:06:41
【问题描述】:
这是我当前的迁移:
class News extends Migration
{
public function up()
{
Schema::create('News', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('description');
$table->integer('user_id')->unsigned()->index();
$table->string('imgPath')->nullable();
$table->timestamps();
});
}
public function down()
{
Schema::drop('News');
}
}
现在我需要对这些列分别进行全文索引:titledescription。所以我正在寻找这样的东西:->fulltext()。但是我在 Laravel 文档中没有找到类似的东西。
不管怎样,
- 如何在迁移中对单个列进行全文索引?喜欢:
(title) - 另外供我参考,如何在迁移中对多个列创建复合全文索引?喜欢:
(title, description)
注意:我想要一个 intex,让我可以像这样搜索:. . . match(col) against('value')
【问题讨论】:
-
人们不应该对好的问题投反对票,这会让会员灰心。