https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43569
--- Comment #1 from Tomás Cohen Arazi (tcohen) <[email protected]> --- Created attachment 206318 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206318&action=edit Bug 43569: Phase 1 - update_index reports per-document failures Koha::SearchEngine::Elasticsearch::Indexer::update_index now returns a Koha::Result::Boolean instead of the raw Elasticsearch response. The result is true when every document indexed successfully (or when there was nothing to index). It is false when the bulk request completed (HTTP 200) but one or more individual documents failed to index; in that case one Koha::Object::Message of type 'error' is recorded per failed document, with the failing record_id and the raw Elasticsearch error in the payload. Whole-operation failures (e.g. Elasticsearch unreachable) keep throwing Koha::Exceptions::Elasticsearch::BadResponse, so the NoNodes recovery path from bug 42669 is preserved. Exceptions mean 'could not run'; a false result means 'ran, but some documents failed'. es_indexer_daemon.pl now inspects the returned Boolean: on a partial failure it logs each failing record and marks the batch 'failed' instead of 'finished', so affected records are no longer silently reported as indexed. Test plan: 1. prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t 2. All subtests pass, including the new 'update_index() return value tests' covering partial failure, full success, empty body and the thrown BadResponse exception. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
