Bugzilla – Attachment 187530 Details for
Bug 40964
koha-elasticsearch is missing --where option
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40964: add --where to koha-elasticsearch wrapper scripts and document it
Bug-40964-add---where-to-koha-elasticsearch-wrappe.patch (text/plain), 3.49 KB, created by
Thomas Klausner
on 2025-10-07 14:47:02 UTC
(
hide
)
Description:
Bug 40964: add --where to koha-elasticsearch wrapper scripts and document it
Filename:
MIME Type:
Creator:
Thomas Klausner
Created:
2025-10-07 14:47:02 UTC
Size:
3.49 KB
patch
obsolete
>From 4712bb7f6d6464933dc016c5953507c92e9bc399 Mon Sep 17 00:00:00 2001 >From: Thomas Klausner <domm@plix.at> >Date: Tue, 7 Oct 2025 14:35:44 +0000 >Subject: [PATCH] Bug 40964: add --where to koha-elasticsearch wrapper scripts > and document it > >Test Plan: > >* Start and enter ktd >* run koha-elasticsearch with --where, which has no effect: > debian/scripts/koha-elasticsearch --rebuild -b -v --where 'biblionumber > 427' kohadev >* But you will see some warnings like: > Unknown instance --where > Unknown instance biblionumber > 427 >* Final output is: Total 435 records indexed > >Apply the patch > >* run the same command again: > debian/scripts/koha-elasticsearch --rebuild -b -v --where 'biblionumber > 427' kohadev >* output should be > Checking state of biblios index > Indexing biblios > Committing final records... > Total 11 records indexed > >* Run `debian/scripts/koha-elasticsearch --help` >* "-w|--where" should show up in the docs > >Sponsored-by: HKS3 >Sponsored-by: Koha DACH Hackfest >--- > debian/docs/koha-elasticsearch.xml | 8 +++++++- > debian/scripts/koha-elasticsearch | 11 +++++++++++ > 2 files changed, 18 insertions(+), 1 deletion(-) > >diff --git a/debian/docs/koha-elasticsearch.xml b/debian/docs/koha-elasticsearch.xml >index a4d49b9191..e180c7276b 100644 >--- a/debian/docs/koha-elasticsearch.xml >+++ b/debian/docs/koha-elasticsearch.xml >@@ -34,7 +34,7 @@ > <arg>-r|--reset</arg> > <arg>-b|--biblios</arg> > <arg>-a|--authorities</arg> >- <arg>-v|--verbose</arg> >+ <arg>-w|--where</arg> > <arg>-c n|--commit n</arg> > <arg>-v|--verbose</arg> > <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg> >@@ -82,6 +82,12 @@ > <para>In conjunction with <option>--rebuild</option> it triggers bibliographic record reindexing.</para> > </listitem> > </varlistentry> >+ <varlistentry> >+ <term><option>-w</option></term> >+ <listitem> >+ <para>In conjunction with <option>--rebuild</option>, pass some arbitrary SQL to limit the records to be indexed.</para> >+ </listitem> >+ </varlistentry> > <varlistentry> > <term><option>-c, --commit</option></term> > <listitem> >diff --git a/debian/scripts/koha-elasticsearch b/debian/scripts/koha-elasticsearch >index 851e97f49b..e9a0a1ba10 100755 >--- a/debian/scripts/koha-elasticsearch >+++ b/debian/scripts/koha-elasticsearch >@@ -46,6 +46,9 @@ Options: > they're added to Elasticsearch (default: 5000). > -p|--processes n Specify the number of parallel processes to use > for indexing. >+ -w|--where SQL Pass some additional SQL to limit the records to >+ be indexed. >+ > --verbose|-v Be verbose. > --help|-h Print this help. > >@@ -114,6 +117,10 @@ run_rebuild_elasticsearch() > rebuild_opts="${rebuild_opts} -v" > fi > >+ if [ "${where}" ]; then >+ rebuild_opts="${rebuild_opts} --where \"${where}\"" >+ fi >+ > # KOHA_HOME and KOHA_BINDIR may have been adjusted/set by adjust_paths_git_install > if koha-shell \ > -c "${KOHA_HOME}/${KOHA_BINDIR}/search_tools/rebuild_elasticsearch.pl ${rebuild_opts}" \ >@@ -133,6 +140,7 @@ commit_size=5000 > processes=1 > verbose="no" > op="" >+where="" > > # Read parameters > while [ -n "$*" ]; do >@@ -158,6 +166,9 @@ while [ -n "$*" ]; do > -p|--processes) > clo_processes="$2" ; shift > ;; >+ -w|--where) >+ where="$2" ; shift >+ ;; > --rebuild) > set_action "rebuild" > ;; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40964
:
187530
|
187555