https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42880

            Bug ID: 42880
           Summary: Avoid the USMARC round-trip when building ES documents
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Searching - Elasticsearch
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
  Target Milestone: ---

For every record, marc_records_to_documents serializes the record to USMARC and
then re-parses it with MARC::Record->new_from_usmarc, purely to "prove it will
round-trip" before storing marc_data (Koha/SearchEngine/Elasticsearch.pm).

Profiling shows this re-decode is roughly 20-25% of the per-record mapping CPU.

The round-trip is a safety net to fall back to MARCXML storage when a record
cannot be represented as USMARC (e.g. length > 99999). That check could run
only
when the encode actually fails, rather than decoding every record on the happy
path.

Test plan:
1. prove t/db_dependent/Koha/SearchEngine/Elasticsearch.t
2. Confirm marc_data is unchanged for normal records.
3. Confirm an over-long record still falls back to MARCXML storage.
4. Benchmark marc_records_to_documents before/after.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to