Bug 36433

Summary: Plugin hook elasticsearch_to_document
Product: Koha Reporter: Frédéric Demians <f.demians>
Component: Plugin architectureAssignee: Frédéric Demians <f.demians>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 36433: UT
Bug 36433: Plugin hook elasticsearch_to_document
Bug 36433: UT
Bug 36433: Plugin hook elasticsearch_to_document

Description Frédéric Demians 2024-03-26 17:10:14 UTC
Add a new hook elasticsearch_to_document in order to allow completing the 'document' to be sent to Elasticsearch. Usage example: (1) add new search fields, (2) normalize/sanitize existing fields, (3) use id fields to retrieve info via web services in other repositories (say VIAF), (4) download file referenced in a field, and index its content.
Comment 1 Frédéric Demians 2024-03-26 17:11:50 UTC
Close to bug 31897
Comment 4 Frédéric Demians 2024-03-26 21:22:09 UTC
Created attachment 163962 [details] [review]
Bug 36433: UT
Comment 5 Frédéric Demians 2024-03-26 21:22:11 UTC
Created attachment 163963 [details] [review]
Bug 36433: Plugin hook elasticsearch_to_document

Add a new hook elasticsearch_to_document in order to allow completing
the 'document' to be sent to Elasticsearch. Usage example: (1) add new
search fields, (2) normalize/sanitize existing fields, (3) use id fields
to retrieve info via web services in other repositories (say VIAF), (4)
download file referenced in a field, and index its content.

To test:

1. Apply the unit tests patch, and run it:

   prove t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t

   => FAIL: Tests fail! The hook is not implemented so the desired

2. Apply this patch, and then repeat 1:

   => SUCCESS: It works!