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 @@
-r|--reset-b|--biblios-a|--authorities
- -v|--verbose
+ -w|--where-c n|--commit n-v|--verboseinstancename
@@ -82,6 +82,12 @@
In conjunction with it triggers bibliographic record reindexing.
+
+
+
+ In conjunction with , pass some arbitrary SQL to limit the records to be indexed.
+
+
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"
;;