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

(-)a/Koha/BiblioUtils.pm (-1 / +6 lines)
Lines 134-145 sub get_all_biblios_iterator { Link Here
134
        $search_terms = \[ 'mod(biblionumber, ?) = ?', $slice_count, $slice_modulo ];
134
        $search_terms = \[ 'mod(biblionumber, ?) = ?', $slice_count, $slice_modulo ];
135
    }
135
    }
136
136
137
    my $search_options = { columns => [qw/ biblionumber /] };
138
    if ( $options{desc} ){
139
        $search_options->{order_by}  = { -desc => 'biblionumber' };
140
    }
141
137
    my $database = Koha::Database->new();
142
    my $database = Koha::Database->new();
138
    my $schema   = $database->schema();
143
    my $schema   = $database->schema();
139
    my $rs =
144
    my $rs =
140
      $schema->resultset('Biblio')->search(
145
      $schema->resultset('Biblio')->search(
141
        $search_terms,
146
        $search_terms,
142
        { columns => [qw/ biblionumber /] } );
147
        $search_options );
143
    my $next_func = sub {
148
    my $next_func = sub {
144
        # Warn and skip bad records, otherwise we break the loop
149
        # Warn and skip bad records, otherwise we break the loop
145
        while (1) {
150
        while (1) {
(-)a/Koha/MetadataRecord/Authority.pm (-1 / +6 lines)
Lines 191-202 sub get_all_authorities_iterator { Link Here
191
        };
191
        };
192
    }
192
    }
193
193
194
    my $search_options->{columns} = [qw/ authid authtypecode marcxml /];
195
    if ($options{desc}) {
196
        $search_options->{order_by} = { -desc => 'authid' };
197
    }
198
194
    my $database = Koha::Database->new();
199
    my $database = Koha::Database->new();
195
    my $schema   = $database->schema();
200
    my $schema   = $database->schema();
196
    my $rs =
201
    my $rs =
197
      $schema->resultset('AuthHeader')->search(
202
      $schema->resultset('AuthHeader')->search(
198
        $search_terms,
203
        $search_terms,
199
        { columns => [qw/ authid authtypecode marcxml /] } );
204
        $search_options);
200
    my $next_func = sub {
205
    my $next_func = sub {
201
        my $row = $rs->next();
206
        my $row = $rs->next();
202
        return if !$row;
207
        return if !$row;
(-)a/misc/search_tools/rebuild_elasticsearch.pl (-3 / +15 lines)
Lines 31-36 B<rebuild_elasticsearch.pl> Link Here
31
[B<-r|--reset>]
31
[B<-r|--reset>]
32
[B<-a|--authorities>]
32
[B<-a|--authorities>]
33
[B<-b|--biblios>]
33
[B<-b|--biblios>]
34
[B<--desc>]
34
[B<-bn|--bnumber>]
35
[B<-bn|--bnumber>]
35
[B<-ai|--authid>]
36
[B<-ai|--authid>]
36
[B<-p|--processes>]
37
[B<-p|--processes>]
Lines 70-75 specifying neither and so both get indexed. Link Here
70
Index the biblios only. Combining this with B<-a> is the same as
71
Index the biblios only. Combining this with B<-a> is the same as
71
specifying neither and so both get indexed.
72
specifying neither and so both get indexed.
72
73
74
=item B<--desc>
75
76
Index the records in descending id order. Intended to index newer record before older records.
77
Default is to index in ascending order.
78
Does not work with --bnumber or --authid
79
73
=item B<-bn|--bnumber>
80
=item B<-bn|--bnumber>
74
81
75
Only index the supplied biblionumber, mostly for testing purposes. May be
82
Only index the supplied biblionumber, mostly for testing purposes. May be
Lines 122-127 my $commit = 5000; Link Here
122
my ($delete, $reset, $help, $man, $processes);
129
my ($delete, $reset, $help, $man, $processes);
123
my ($index_biblios, $index_authorities);
130
my ($index_biblios, $index_authorities);
124
my (@biblionumbers,@authids);
131
my (@biblionumbers,@authids);
132
my $desc;
125
133
126
$|=1; # flushes output
134
$|=1; # flushes output
127
135
Lines 131-138 GetOptions( Link Here
131
    'r|reset'       => \$reset,
139
    'r|reset'       => \$reset,
132
    'a|authorities' => \$index_authorities,
140
    'a|authorities' => \$index_authorities,
133
    'b|biblios'     => \$index_biblios,
141
    'b|biblios'     => \$index_biblios,
134
    'bn|bnumber=i' => \@biblionumbers,
142
    'desc'          => \$desc,
135
    'ai|authid=i'  => \@authids,
143
    'bn|bnumber=i'  => \@biblionumbers,
144
    'ai|authid=i'   => \@authids,
136
    'p|processes=i' => \$processes,
145
    'p|processes=i' => \$processes,
137
    'v|verbose+'    => \$verbose,
146
    'v|verbose+'    => \$verbose,
138
    'h|help'        => \$help,
147
    'h|help'        => \$help,
Lines 183-188 if ($slice_count > 1) { Link Here
183
    $iterator_options{slice} = { index => $slice_index, count => $slice_count };
192
    $iterator_options{slice} = { index => $slice_index, count => $slice_count };
184
}
193
}
185
194
195
if( $desc ){
196
    $iterator_options{desc} = 1;
197
}
198
186
my $next;
199
my $next;
187
if ($index_biblios) {
200
if ($index_biblios) {
188
    _log(1, "Indexing biblios\n");
201
    _log(1, "Indexing biblios\n");
189
- 

Return to bug 26180