Add `search:re-import` command
nunomaduro opened this issue · comments
Nuno Maduro commented
The goal here is to add search:re-import
command, that uses the temporary index
technique behind the scenes.
About this command:
Push a new set of objects and remove all previous ones. Settings, synonyms and query rules are untouched. Replace all records in an index without any downtime.
Internally, this method copies the existing index settings, synonyms and query rules and indexes all passed objects. Finally, the existing index is replaced by the temporary one.
Here is an example of this tecnique implemented on scout extented: https://github.com/algolia/scout-extended/blob/master/src/Console/Commands/ReImportCommand.php.
Gregory House commented
In addition to that it should probably take care about clearing the EM every, say, 1000 records indexed - with larger datasets it's really problematic ;)