Koha-clms/Koha/SearchEngine/Elasticsearch
Thomas Klausner 55308aa365
Bug 21820: Add ElasticsearchEnableZebraQueue syspref to control Zebra indexing when using Elasticsearch
Previously, Koha always added items to the Zebra queue when indexing via Elasticsearch. This adds a new system preference ElasticsearchEnableZebraQueue that allows disabling this behavior.

Unit Test:

* run the unit test t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t
* there should be a new subtest like this:

    1..5
    ok 1 - We start with an empty zebra queue
    ok 2 - new entry in zebraqueue for auth
    ok 3 - new entry in zebraqueue for biblio
    ok 4 - no new entry in zebraqueue for auth
    ok 5 - no new entry in zebraqueue for biblio
ok 5 - syspref ElasticsearchEnableZebraQueue

Manual Test Plan:

* Start ktd with Elasticsearch enabled
* As there is no interface to the zebraqueue, you need to connect to the DB and use SQL directly
  * ktd --dbshell
  * `select count(*) from zebraqueue;`
  * remember that number
* Edit any biblio or auth
* Check the zebraqueue again via SQL
* There should be one more entry

* Now apply the patch
* Then got to Sysprefs and set ElasticsearchEnableZebraQueue to `Disable`

* Edit another biblio or auth
  * has to be a different one, because Koha will prevent the same ID to be added again to zebraqueue
* Again check  zebraqueue via SQL
* There should be *no* new entry

QA Note:

the qa tool reports
[FAIL] Koha/SearchEngine/Elasticsearch/Indexer.pm
   FAIL	 pod_coverage
		sub _get_record has no pod coverage.

But this patch does not touch this code, so I guess this fail is caused by a stricter qa tool

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-04-15 11:37:18 -06:00
..
Browse.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Indexer.pm Bug 21820: Add ElasticsearchEnableZebraQueue syspref to control Zebra indexing when using Elasticsearch 2026-04-15 11:37:18 -06:00
QueryBuilder.pm Bug 28884: (QA follow-up) Add some missing pod 2026-03-26 14:21:16 +01:00
Search.pm Bug 42107: Add search scores to staff results page 2026-04-15 11:37:12 -06:00