Task #13272

Use resource's id instead of the full resource to create/update the Elasticsearch document

Added by José Raddaoui Marín over 1 year ago.

Status:NewStart date:03/13/2020
Priority:MediumDue date:
Assignee:-% Done:

0%

Category:Performance / scalability
Target version:-
Google Code Legacy ID: Tested version:
Sponsored:No Requires documentation:

Description

The functions used to update and delete Elasticsearch documents receive the hydrated resource to perform the update. However, the majority of documents are generated using raw SQL and, in some cases, those resources are hydrated from the database just to call the update function, adding an unnecessary burden to the process. For example:

https://github.com/artefactual/atom/blob/qa/2.6.x/lib/model/QubitRepository.php#L167-L175

These functions determine the ES index type (and related model) using the resource's class name, something that could be passed directly to the functions:

https://github.com/artefactual/atom/blob/qa/2.6.x/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php#L562-L585
https://github.com/artefactual/atom/blob/qa/2.6.x/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php#L519-L560
https://github.com/artefactual/atom/blob/qa/2.6.x/plugins/arElasticSearchPlugin/lib/arElasticSearchPlugin.class.php#L469-L499


Related issues

Related to Access to Memory (AtoM) - Task #13261: Improve Elasticsearch indexing process Verified 02/16/2020

History

#1 Updated by José Raddaoui Marín over 1 year ago

  • Related to Task #13261: Improve Elasticsearch indexing process added

Also available in: Atom PDF