[Koha-bugs] [Bug 35345] New: Pass custom SQL to rebuild_elasticsearch.pl

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Nov 16 10:45:33 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35345

            Bug ID: 35345
           Summary: Pass custom SQL to rebuild_elasticsearch.pl
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: new feature
          Priority: P5 - low
         Component: Searching - Elasticsearch
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: domm at plix.at

Sometimes we need to only re-index a subset of our bibliographic data or
authorities. Currently this is only possible by enumerating all id (-bn or
-ai), which does not work well when indexing eg 100.000 items of a 2.000.000
DB. Re-indexing everything is also overkill.

I propose adding an `--sql` Flag to misc/search_tools/rebuild_elasticsearch.pl
which can take arbitrary SQL (that of course has to match the respective
tables) and adds it as an additional param to the resultset to index:

Example:

* Only index auths of type Geograpy: misc/search_tools/rebuild_elasticsearch.pl
-a -v --sql "authtypecode = 'GEOGR_NAME'"

* Only index books with id 100-150: misc/search_tools/rebuild_elasticsearch.pl
-b -v --sql "biblionumber between 100 and 150"

In this first version only columns available in the primary tables (biblio,
auth_header) are available. Later we could add command line options for joining
other tables (eg biblio_metadata).

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list