Skip to first unread message

ism...@gmail.com

unread,
Jan 20, 2021, 3:16:34 AM1/20/21
to AtoM Users

Good morning, we currently have many archival descriptions in AtoM with many digital images; and every time I run a command to delete digital objects uploaded by mistake, or to include new ones, AtoM does not reindex those changes so it is necessary to reindex everything with php symfony search: populate.

Given the amount of content it takes a long time to reindex. My question: is it possible to reindex only the changes of the slug that I indicate through command line?

Regards.

José Raddaoui

unread,
Jan 20, 2021, 3:40:51 AM1/20/21
to AtoM Users
Hi,

Yes, you could use the "--slug" option to index a resource and its descendants:

php symfony search:populate --slug=example-description

You could also disable the descendants update with the "--ignore-descendants" option. More info:


Best regards,
Radda.

ism...@gmail.com

unread,
Jan 21, 2021, 6:57:18 AM1/21/21
to AtoM Users
Hello and thank you for the prompt reply. I have another command question Is it possible by command or another way, to remove the child descriptions of another given by slug, without removing the parent? Regards.

Dan Gillean

unread,
Jan 21, 2021, 12:34:19 PM1/21/21
to ICA-AtoM Users
Hi Isabel, 

We don't have a task right now that can remove the descendants of a description but leave the parent record intact. If you use the delete descriptions task with a slug as input, it will remove descendants in addition to the target parent, but you'd have to manually recreate the parent record that way. See: 
There is also a task that will delete draft descriptions - so if the descendants of your target record were the ONLY draft descriptions in your AtoM instance, then that could work as well: 
Finally, if you are feeling confident, you could try to delete the descriptions using SQL. A couple of caveats before proceeding: 
  • DO NOT PROCEED without making a backup of your data first!
  •  If there are lower-level descendants (i.e. if the children have children), the following query will ONLY work for 2.6! By this I mean that if the children you are trying to delete ALSO have child records of their own (for example, you want to delete a bunch of files in a series, but some or all of those file-level records have item-level children), then only use this query if you are on 2.6. We made some changes in 2.6 to better handle these kinds of cascading operations (see #10306), but in 2.5 and earlier, this could leave corrupted data in your system as these records would be left without a parent ID, and even top-level descriptions in AtoM have a parent_id value of 1 (they are attached to an internal root record not shown in the user interface)
  • This is provided as an untested suggestion by myself as an individual. Artefactual takes no responsibility for the outcome! 
I did test this once internally and run it by a developer, but in general, Artefactual does not advise messing with AtoM data directly via SQL, so proceed at your own risk!

You will need to access the MySQL command prompt, which means you will need to know the database username and password used during installation. Tips on how to find this information, and how to open the MySQL command prompt, can be found here: 
First we'll need to find out the object ID of the parent description. We can do that with the following if we know the slug: 
  • SELECT object_id FROM slug WHERE slug='your-slug-here';
Replace your-slug-here with the slug of the target parent description whose children you want to delete. See:
Once we have the object ID, we can now use that in a command to delete any records that have that ID set as the parent ID value. In this case, we want to delete directly from the object table - most main entity types in AtoM have a record in this table, where the object ID is originally created, and deleting from here ensures that the deletion will cascade across any associated tables (such as information_object, information_object_i18n, note and note_i18n, property and property_i18n, etc...). 
  • DELETE o FROM object o JOIN information_object io ON o.id = io.id WHERE io.parent_id='XXXXX';
Replace XXXXX in the example above with the object ID you got from the first query. 

After you've done this you'll want to clear the application cache, restart PHP-FPM, rebuild the nested set, and repopulate the search index. 
You may also want to clear your web browser cache before checking on the results, to ensure you are seeing an up-to-date version of the page. 

Good luck, and if you try it, let us know how it goes!

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/550515be-1009-4e53-9198-17d491f65647n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages