mapping des dates pour sorting correct via elastic search
This commit is contained in:
parent
4f722589ae
commit
c6f2b92e05
2 changed files with 13 additions and 6 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue