Populate search index¶
Occasionaly it is necessary to repopulate the Elasticsearch index from the primary database, especially after operations that affect many records, e.g.
- Importing data (CSV or EAD import)
- Moving a large series to a new parent record
- Moving a Fonds or Collection to a different archival institution
- Doing any bulk search and replace operation
Populating the search index requires running a Symfony command line task, which is located in the root directory of the application. Running this task will delete the current index, then repopulate and optimize the index. Depending on the number of records in your installation, this can take a while to run - for production sites, we recommend running this task after regular business hours.
To run the task without any of the available options, enter the following in the command-line interface, in the root AtoM directory:
php symfony search:populate
You can also run
php symfony help search:populate to see the available
options for this command-line task:
--env options should not be used - AtoM
requires the uses of the pre-set defaults for Symfony to be able to execute
--exclude-types option can be used if you do not want to re-index
certain record types. When this option is used, the existing index is not
completely flushed - the current part of the index for the excluded types will
be maintained, while other entities will be flushed and re-indexed. This can
be useful if, for example, you have many archival descriptions (which would
take a long time to re-index), but only need to re-index your authority
records and/or other entities - you could then use the command with
--exclude-types="informationobject and the existing index for descriptions
would be maintained.
Below is a list of the types that can be excluded using this option:
- actor (i.e. authority record)
- aip (indexed during a DIP upload from Archivematica)
- informationobject (i.e. archival description)
- repository (i.e. archival institution)
- term (such as subjects and places, etc)
You can exclude multiple types at once, by separating them with commas - don’t leave spaces between the commas. For example, to re-index your site but skip indexing terms (such as subject and place access points), authority records, and archival descriptions, you could enter the command like so:
php symfony search:populate --exclude-types="term,actor,informationobject"
The command will indicate at the beginning which types are being re-indexed, and then will output the results of indexing the remaining entities:
You can also use the
--show-types option to display the available index
types prior to indexing. When run, the task will display a list of available
types in your AtoM instance:
Pressing enter will continue and run the
search:populate task (with no
types), or alternatively, you can exit the task by entering
then re-enter your parameters, using
--exclude-types as needed.