diff --git a/app/Console/Commands/reindexElasticMedia.php b/app/Console/Commands/reindexElasticMedia.php index 61dac39..1744c68 100644 --- a/app/Console/Commands/reindexElasticMedia.php +++ b/app/Console/Commands/reindexElasticMedia.php @@ -47,11 +47,16 @@ class reindexElasticMedia extends Command } else { $startFrom = 1; } - if (Media::indexExists() && !$bReprise) + $this->info('Test Présence...'); + if (Media::indexExists() && !$bReprise) { + $this->info('Suppression index...'); Media::deleteIndex(); + } - if(!$bReprise) + if(!$bReprise) { + $this->info('Création...'); Media::createIndex(); + } $medias = Media::all(); $bar = $this->output->createProgressBar(count($medias)); diff --git a/app/Models/Media.php b/app/Models/Media.php index f1a8bb7..e5d1d03 100644 --- a/app/Models/Media.php +++ b/app/Models/Media.php @@ -94,12 +94,14 @@ class Media extends Model 'fielddata' => true ), 'created_at' => array( - 'type' => 'text', - 'fielddata' => true + 'type' => 'date', + "format" => "yyyy-MM-dd HH:mm:ss", + //'fielddata' => true ), 'updated_at' => array( - 'type' => 'text', - 'fielddata' => true + 'type' => 'date', + "format" => "yyyy-MM-dd HH:mm:ss", + //'fielddata' => true ), 'version' => array( 'type' => 'text',