Currently the whole MARC Record is stored in the ElasticSearch Record. At the Koha Hackfest 2025 I learned that one reason for this is to be able to search the whole record (Bug 22258). Another reason might be to avoid hitting the DB when displaying search results. But: * We sometime encounter problems with very large records (due to limits with UNIMARC) * The code to store the whole record is rather convoluted (involes encoding/decoding the record, checking for errors, falling back to other encoding methods..) * It bloats the ES index (if it's not needed) So I will investigate: * would displaying search results work without the whole MARC record? * aren't we hitting the DB anyway during displaying search results * in OPAC * in Staff * in API If it seems easy to optionally not add the whole record to the index, I would suggest * Adding a new Option "Don't store" to syspref ElasticsearchMARCFormat * If it is set, skip adding the whole MARC
I find this idea interesting as well. Another benefit is that it would help us to separate away from MARC in the future. We can index anything into our search engine, do a consistent search, and then do display either using the search engine result or using whatever makes sense on a per record basis.
This isn't a topic that I would urgently pursue, but if someone (ie you Thomas) plan to work on it, I'd be happy to do test/QA on it.