We recommend setting up a cron job for the Elasticsearch task that periodically re-initializes the database.
The task responsible for this can be called as follows:
./symfony elasticsearch:index
It supports the following parameters:
--verbose
Enables the detailed output.
--housekeeping
Performs cleanup of orphaned data within Elasticsearch only (i.e., data that is no longer in VIMP but still exists in Elasticsearch).
--reindex
Initializes the indexes within the Elasticsearch instance (new) by deleting the old indexes and creating new ones.
Via a cron job the task can be called e.g. like this:
0 4 * * * php -f /path/to/vimp/symfony -- elasticsearch:index >> /path/to/vimp/log/elasticsearch-indexing.log 2>&1