$renews = ( $item_object->renewals || 0 ) + 1;
$item_object->renewals($renews);
$item_object->onloan($datedue);
- $item_object->store({ log_action => 0 });
+ # Don't index as we are in a transaction
+ $item_object->store({ log_action => 0, skip_record_index => 1 });
# Charge a new rental fee, if applicable
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
}
});
});
+ # We index now, after the transaction is committed
+ my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
+ $indexer->index_records( $item_object->biblionumber, "specialUpdate", "biblioserver" );
return $datedue;
}
$params can take an optional 'skip_record_index' parameter.
If set, the reindexation process will not happen (index_records not called)
-
-NOTE: This is a temporary fix to answer a performance issue when lot of items
-are added (or modified) at the same time.
-The correct way to fix this is to make the ES reindexation process async.
You should not turn it on if you do not understand what it is doing exactly.
=cut