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

(-)a/Koha/SearchEngine/Elasticsearch/Search.pm (-3 / +16 lines)
Lines 158-166 sub search_compat { Link Here
158
    $index = $offset; # opac-search expects results to be put in the
158
    $index = $offset; # opac-search expects results to be put in the
159
        # right place in the array, according to $offset
159
        # right place in the array, according to $offset
160
    $results->each(sub {
160
    $results->each(sub {
161
            my $marc;
161
            # The results come in an array for some reason
162
            # The results come in an array for some reason
162
            my $marc_json = $_[0]->{record};
163
            unless (ref($_[0]->{'Local-number'}) ){
163
            my $marc = $self->json2marc($marc_json);
164
# shift this to overdrive stuff
165
                $marc = MARC::Record->new();
166
                $marc->add_fields(
167
                        [ 245, "1", " ", a => $_[0]->{title}, b=> $_[0]->{subtitle} ],
168
                        [ 100, "", "", a => $_[0]->{'primaryCreator'}->{'name'}],
169
                        [ 999, "", "", c => $_[0]->{'Local-number'}],
170
                        [ 999, "", "", d => $_[0]->{'Local-number'}],
171
                        [ 999, "", "", a => 'ExtOverdrive' ],
172
                        );
173
            }
174
            else {
175
               my $marc_json = $_[0]->{record};
176
               $marc = $self->json2marc($marc_json);
177
            }
164
            $records[$index++] = $marc;
178
            $records[$index++] = $marc;
165
        });
179
        });
166
    # consumers of this expect a name-spaced result, we provide the default
180
    # consumers of this expect a name-spaced result, we provide the default
167
- 

Return to bug 18514