support patching the mapping without recreating

This commit is contained in:
Daniel Klabbers 2021-11-16 20:33:17 +01:00
parent cb7da5d3f8
commit 68fce10d56
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@ class BuildCommand extends Command
{--throttle= : Number of seconds to wait between pushing to the queue} {--throttle= : Number of seconds to wait between pushing to the queue}
{--only= : type to run seeder for, eg discussions or posts} {--only= : type to run seeder for, eg discussions or posts}
{--recreate : create or recreate the index} {--recreate : create or recreate the index}
{--mapping : recreate the mapping}
{--continue : continue each object type where you left off}'; {--continue : continue each object type where you left off}';
protected $description = 'Rebuilds the complete search server with its documents.'; protected $description = 'Rebuilds the complete search server with its documents.';
@ -76,7 +77,9 @@ class BuildCommand extends Command
] ]
] ]
]); ]);
}
if ($this->option('recreate') || $this->option('mapping')) {
$client->indices()->putMapping([ $client->indices()->putMapping([
'index' => $index, 'index' => $index,
'body' => $properties 'body' => $properties