Bug 36433 - Plugin hook elasticsearch_to_document
Summary: Plugin hook elasticsearch_to_document
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Frédéric Demians
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-26 17:10 UTC by Frédéric Demians
Modified: 2025-02-27 12:53 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 36433: UT (3.27 KB, patch)
2024-03-26 17:24 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 36433: Plugin hook elasticsearch_to_document (1.47 KB, patch)
2024-03-26 17:24 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 36433: UT (3.39 KB, patch)
2024-03-26 21:22 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 36433: Plugin hook elasticsearch_to_document (1.53 KB, patch)
2024-03-26 21:22 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 36433: UT (3.44 KB, patch)
2024-09-26 20:05 UTC, Shi Yao Wang
Details | Diff | Splinter Review
Bug 36433: Plugin hook elasticsearch_to_document (1.58 KB, patch)
2024-09-26 20:05 UTC, Shi Yao Wang
Details | Diff | Splinter Review
Bug 36433: UT (3.52 KB, patch)
2025-01-17 18:41 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 36433: Plugin hook elasticsearch_to_document (1.66 KB, patch)
2025-01-17 18:41 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 36433: fix test failing on Jenkins (1.07 KB, patch)
2025-02-25 15:23 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 36433: (follow-up) Include required library (893 bytes, patch)
2025-02-27 03:06 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!
Comment 6 Shi Yao Wang 2024-09-26 20:05:37 UTC
Created attachment 172062 [details] [review]
Bug 36433: UT

Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>
Comment 7 Shi Yao Wang 2024-09-26 20:05:39 UTC
Created attachment 172063 [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!

Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>
Comment 8 Kyle M Hall (khall) 2025-01-17 18:41:02 UTC
Created attachment 176749 [details] [review]
Bug 36433: UT

Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall (khall) 2025-01-17 18:41:41 UTC
Created attachment 176750 [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!

Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Katrin Fischer 2025-02-20 16:49:59 UTC
Please update https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks!
Comment 11 Katrin Fischer 2025-02-21 09:42:20 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 12 Frédéric Demians 2025-02-24 13:20:09 UTC
Thanks. Wiki page updated.
Comment 13 Katrin Fischer 2025-02-24 13:29:18 UTC
(In reply to Frédéric Demians from comment #12)
> Thanks. Wiki page updated.

+1
Comment 15 Frédéric Demians 2025-02-25 15:20:59 UTC
(In reply to Katrin Fischer from comment #14)
> This makes one of the tests on Jenkins fail, please check and fix:

Thanks. This is the group of tests introduced by this patch which are not executed by Jenkins, apparently. I can't reproduce on my box. I make the assumption that it is due to the lack of a db transaction rollback, and propose a fix. Hope that's it.
Comment 16 Frédéric Demians 2025-02-25 15:23:20 UTC
Created attachment 178685 [details] [review]
Bug 36433: fix test failing on Jenkins

Transaction rollback not called.
Comment 17 Katrin Fischer 2025-02-26 10:34:53 UTC
Thanks, Frederic, let's try with your patch!
Comment 18 Tomás Cohen Arazi (tcohen) 2025-02-27 03:06:10 UTC
Created attachment 178778 [details] [review]
Bug 36433: (follow-up) Include required library

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 19 Katrin Fischer 2025-02-27 12:53:49 UTC
Follow-up "Include required library" pushed to main.