View | Details | Raw Unified | Return to bug 15113
Collapse All | Expand All

(-)a/debian/docs/koha-rebuild-zebra.xml (-3 / +9 lines)
Lines 23-29 Link Here
23
23
24
  <refsynopsisdiv>
24
  <refsynopsisdiv>
25
    <cmdsynopsis>
25
    <cmdsynopsis>
26
      <command>koha-rebuild-zebra</command> <arg><option>-u</option>|<option>--usmarc</option></arg> <arg><option>-f</option>|<option>--full</option></arg> <arg><option>-a</option>|<option>--authorities</option></arg> <arg><option>-b</option>|<option>--biblios</option></arg> <arg><option>-q</option>|<option>--quiet</option></arg> <arg><option>-v</option>|<option>--verbose</option></arg> <arg><option>...</option></arg> <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg>
26
      <command>koha-rebuild-zebra</command> <arg><option>-u</option>|<option>--usmarc</option></arg> <arg><option>--force</option></arg> <arg><option>-f</option>|<option>--full</option></arg> <arg><option>-a</option>|<option>--authorities</option></arg> <arg><option>-b</option>|<option>--biblios</option></arg> <arg><option>-q</option>|<option>--quiet</option></arg> <arg><option>-v</option>|<option>--verbose</option></arg> <arg><option>...</option></arg> <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg>
27
    </cmdsynopsis>
27
    </cmdsynopsis>
28
  </refsynopsisdiv>
28
  </refsynopsisdiv>
29
  
29
  
Lines 36-44 Link Here
36
      </listitem>
36
      </listitem>
37
    </varlistentry>
37
    </varlistentry>
38
    <varlistentry>
38
    <varlistentry>
39
      <term><option>--force</option></term>
40
      <listitem>
41
        <para>Force incremental indexing when <option>USE_INDEXER_DAEMON=yes</option>.</para>
42
      </listitem>
43
    </varlistentry>
44
    <varlistentry>
39
      <term><option>-f, --full</option></term>
45
      <term><option>-f, --full</option></term>
40
      <listitem>
46
      <listitem>
41
        <para>Does a reindex of the whole collection.</para>
47
        <para>Does a reindex of the whole collection. Will run even if <option>USE_INDEXER_DAEMON=yes</option>.</para>
42
      </listitem>
48
      </listitem>
43
    </varlistentry>
49
    </varlistentry>
44
    <varlistentry>
50
    <varlistentry>
Lines 75-81 Link Here
75
  </refsect1>
81
  </refsect1>
76
82
77
  <refsect1><title>Description</title>
83
  <refsect1><title>Description</title>
78
  <para>Rebuild the Zebra database for Koha instances.</para>
84
  <para>Rebuild the Zebra database for Koha instances. It will run incremental updates by default. It will be skipped if <option>USE_INDEXER_DAEMON=yes</option> in /etc/default/koha-common, unless <option>--force</option> or <option>--full</option> are used.</para>
79
  </refsect1>
85
  </refsect1>
80
  
86
  
81
  <refsect1><title>See also</title>
87
  <refsect1><title>See also</title>
(-)a/debian/scripts/koha-rebuild-zebra (-10 / +25 lines)
Lines 19-24 Link Here
19
19
20
set -e
20
set -e
21
21
22
# Read configuration variable file if it is present
23
[ -r /etc/default/koha-common ] && . /etc/default/koha-common
24
22
# include helper functions
25
# include helper functions
23
if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then
26
if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then
24
    . "/usr/share/koha/bin/koha-functions.sh"
27
    . "/usr/share/koha/bin/koha-functions.sh"
Lines 49-63 run_rebuild_zebra() Link Here
49
{
52
{
50
    local instancename=$1; shift
53
    local instancename=$1; shift
51
54
52
    # TODO: This comment is here to remind us that we should make
55
    if [ "$USE_INDEXER_DAEMON" = "no"  ] ||
53
    # rebuild_zebra.pl return error codes on failure
56
       [     "${full_reindex}" = "yes" ] ||
54
    if sudo -u "$instancename-koha" -H \
57
       [            "${force}" = "yes" ] ; then
55
        env PERL5LIB=/usr/share/koha/lib \
58
56
        KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \
59
        # TODO: This comment is here to remind us that we should make
57
        /usr/share/koha/bin/migration_tools/rebuild_zebra.pl $@ ; then
60
        # rebuild_zebra.pl return error codes on failure
58
        return 0
61
        if sudo -u "$instancename-koha" -H \
59
    else
62
            env PERL5LIB=/usr/share/koha/lib \
60
        return 1
63
            KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \
64
            /usr/share/koha/bin/migration_tools/rebuild_zebra.pl $@ ; then
65
            return 0
66
        else
67
            return 1
68
        fi
61
    fi
69
    fi
62
}
70
}
63
71
Lines 75-80 Options: Link Here
75
    --authorities|-a  Only run process for authorities.
83
    --authorities|-a  Only run process for authorities.
76
    --biblios|-b      Only run process for biblios.
84
    --biblios|-b      Only run process for biblios.
77
    --full|-f         Does a reindex of the whole collection.
85
    --full|-f         Does a reindex of the whole collection.
86
    --force           Run incremental indexing even if USE_INDEXER_DAEMON="yes"
78
    --quiet|-q        Sometimes be a bit quieter for scripts/cronjobs.
87
    --quiet|-q        Sometimes be a bit quieter for scripts/cronjobs.
79
    --verbose|-v      Be verbose.
88
    --verbose|-v      Be verbose.
80
    --help|-h         Print this help.
89
    --help|-h         Print this help.
Lines 93-98 biblios_only="no" Link Here
93
authorities_only="no"
102
authorities_only="no"
94
biblios="yes"
103
biblios="yes"
95
authorities="yes"
104
authorities="yes"
105
force="no"
106
full_reindex="no"
107
96
# The '-q' option is intended to prevent the cronjob causing this to output
108
# The '-q' option is intended to prevent the cronjob causing this to output
97
# help information if there are no instances defined.
109
# help information if there are no instances defined.
98
quiet="no"
110
quiet="no"
Lines 113-120 while [ -n "$*" ]; do Link Here
113
            opt_xml=""
125
            opt_xml=""
114
            ;;
126
            ;;
115
        -f|--full)
127
        -f|--full)
128
            full_reindex="yes"
116
            opt_idx="-r"
129
            opt_idx="-r"
117
            ;;
130
            ;;
131
        --force)
132
            force="yes"
133
            ;;
118
        -v|--verbose)
134
        -v|--verbose)
119
            opt_verbose="-v"
135
            opt_verbose="-v"
120
            ;;
136
            ;;
121
- 

Return to bug 15113