Bugzilla – Attachment 150863 Details for
Bug 33576
Records are not indexed when imported if using Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33576: Index records after import transaction is committed
Bug-33576-Index-records-after-import-transaction-i.patch (text/plain), 1.74 KB, created by
Marcel de Rooy
on 2023-05-09 13:01:59 UTC
(
hide
)
Description:
Bug 33576: Index records after import transaction is committed
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-05-09 13:01:59 UTC
Size:
1.74 KB
patch
obsolete
>From cf4ea7b7610fc74e8abc531f2f3950d7cf632575 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 20 Apr 2023 16:02:09 +0000 >Subject: [PATCH] Bug 33576: Index records after import transaction is > committed >Content-Type: text/plain; charset=utf-8 > >This patch simply moves our indexing call after the transaction is committed so >that the job will exist in the DB when called. > >To test: > 1 - Have Koha using Elasticsearch > 2 - Stage and import a file of records > 3 - View the job in Admin->Manage jobs > 4 - Note it is not finished > 5 - Check log: /var/log/koha/kohadev/es-indexer-output.log > 6 - Note: [WARN] No job found for id=### > 7 - Apply patch > 8 - Stage and import > 9 - Note no error in log >10 - Note successful completion of indexing job > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/ImportBatch.pm | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index 8f5cf00a1c..a200876bb2 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -714,15 +714,16 @@ sub BatchCommitRecords { > > $sth->finish(); > >+ SetImportBatchStatus($batch_id, 'imported'); >+ >+ # Moved final commit to the end >+ $schema->txn_commit; >+ > if ( @biblio_ids ) { > my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); > $indexer->index_records( \@biblio_ids, "specialUpdate", "biblioserver" ); > } > >- SetImportBatchStatus($batch_id, 'imported'); >- >- # Moved final commit to the end >- $schema->txn_commit; > > return ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored); > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33576
:
149971
|
150147
|
150591
|
150592
| 150863 |
150864