How can i create text index in migrations?
Hey, guys!
It's realy good qquestion.
How can I run totally raw query?
Need something like
DB::statement('db.proposals.createIndex( { summary: "text", content: "text", title: "text" } )');
@jenssegers
@saeedvaziry
https://github.com/jenssegers/laravel-mongodb/wiki/Creating-Full-Text-Index-With-Laravel-Migration-Using-Moloquent
Here is the answer)
@Sebbba Thanks for your answer. I used this solution to my problem
https://docs.mongodb.com/php-library/current/tutorial/indexes/#create-indexes
Schema::table('provinces', function (Blueprint $table) {
$table->index(['name' => 'text'], 'name_full_text');
});
Most helpful comment