<?php
declare(strict_types=1);
use ElasticAdapter\Indices\Mapping;
use ElasticAdapter\Indices\Settings;
use ElasticMigrations\Facades\Index;
use ElasticMigrations\MigrationInterface;
final class CreateUsersIndex implements MigrationInterface
{
/**
* Run the migration.
*/
public function up(): void
{
Index::create('users', function (Mapping $mapping, Settings $settings) {
$mapping->text('name');
$mapping->keyword('email');
});
}
/**
* Reverse the migration.
*/
public function down(): void
{
Index::dropIfExists('users');
}
}
I ran the migration and it was created. Then I ran php artisan scout:import "App\Models\User" and it says Imported [App\Models\User] models up to ID: 368
it returns nothing. I guess I am a bit confused because with scout-elasticsearch-driver I ran php artisan elastic:create-index "App\Models\UserIndexConfigurator"; and then php artisan scout:import "App\Models\User"; and I could see them in the indeces.
Hi! I am very excited to get this working as I was using scout-elasticsearch-driver before and I loved it.
I am using
and I have created a user index
I ran the migration and it was created. Then I ran php artisan scout:import "App\Models\User" and it says Imported [App\Models\User] models up to ID: 368
However if I do http://127.0.0.1:9200/create_users_index it shows that there is "no such index [create_users_index]",
Then when I try and do a search
it returns nothing. I guess I am a bit confused because with scout-elasticsearch-driver I ran php artisan elastic:create-index "App\Models\UserIndexConfigurator"; and then php artisan scout:import "App\Models\User"; and I could see them in the indeces.