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

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

Return to bug 18514