Bug 27344: Implement Elastic's update_index_background using Koha::BackgroundJob
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 5 Jan 2021 13:42:20 +0000 (14:42 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 3 May 2022 21:19:49 +0000 (11:19 -1000)
commit4d1566d3244c765e2d7c13e941e0714f63bcd0ef
tree3454d97be2378aae22bede138b367c0ecb199265
parent4c9db3856aff65123864a56088f89b9121c90ef9
Bug 27344: Implement Elastic's update_index_background using Koha::BackgroundJob

This patch adds a background job submodule, UpdateElasticIndex, to deal
with async ES index update (not the deletion).

Using NYTProf (on a checkin):
Without
618ms, executing 35676 statements and 26355 subroutine calls in 266 source files and 83 string evals.

With
521ms, executing 13282 statements and 7979 subroutine calls in 195 source files and 26 string evals.

However there are some problems with this patch:
1. We don't want *all* the index update to be in the background_jobs
tabtle (we could add a filter on the list view)
2. We don't track the "progress" of the job as we are sending all the
records to Elastic. It is okish in my opinion but it must be noted.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/BackgroundJob.pm
Koha/BackgroundJob/UpdateElasticIndex.pm [new file with mode: 0644]
Koha/SearchEngine/Elasticsearch/Indexer.pm
koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs_update_elastic_index.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt