Bug 39552

Summary: Add a hook/plugin to Elasticsearch indexing to modify record
Product: Koha Reporter: Thomas Klausner <domm>
Component: Searching - ElasticsearchAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: michaela.sieber
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31897
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Thomas Klausner 2025-04-03 15:11:10 UTC
As discussed at the Koha Hackfest 2025:

Sometimes we need conditional indexing of fields (008 based on leader, 264 based on indicator).

Instead of complicating the yml file and the DB, we can add a hook after the ES record has been created but before it is sent to ES. This hook should get the ES record and the MARC record (and maybe even the biblio/auth object) and return the modified ES record.

So you can implement whatever weird conditionals etc you need, or even any other modifications (eg getting number of items, advanced geo stuff, ..) without us having to make core very complex.
Comment 1 Michaela Sieber 2025-04-08 11:34:05 UTC
See bug 36433

*** This bug has been marked as a duplicate of bug 36433 ***