|
Lines 174-186
sub search_compat {
Link Here
|
| 174 |
|
174 |
|
| 175 |
# Convert each result into a MARC::Record |
175 |
# Convert each result into a MARC::Record |
| 176 |
my @records; |
176 |
my @records; |
|
|
177 |
my @scores; |
| 177 |
|
178 |
|
| 178 |
# opac-search expects results to be put in the |
179 |
# opac-search expects results to be put in the |
| 179 |
# right place in the array, according to $offset |
180 |
# right place in the array, according to $offset |
| 180 |
my $index = $offset; |
181 |
my $index = $offset; |
| 181 |
my $hits = $results->{'hits'}; |
182 |
my $hits = $results->{'hits'}; |
| 182 |
foreach my $es_record ( @{ $hits->{'hits'} } ) { |
183 |
foreach my $es_record ( @{ $hits->{'hits'} } ) { |
| 183 |
$records[ $index++ ] = $self->decode_record_from_result( $es_record->{'_source'} ); |
184 |
$records[$index] = $self->decode_record_from_result( $es_record->{'_source'} ); |
|
|
185 |
$scores[ $index++ ] = $es_record->{'_score'}; |
| 184 |
} |
186 |
} |
| 185 |
|
187 |
|
| 186 |
# consumers of this expect a name-spaced result, we provide the default |
188 |
# consumers of this expect a name-spaced result, we provide the default |
|
Lines 188-193
sub search_compat {
Link Here
|
| 188 |
my %result; |
190 |
my %result; |
| 189 |
$result{biblioserver}{hits} = $hits->{'total'}; |
191 |
$result{biblioserver}{hits} = $hits->{'total'}; |
| 190 |
$result{biblioserver}{RECORDS} = \@records; |
192 |
$result{biblioserver}{RECORDS} = \@records; |
|
|
193 |
$result{biblioserver}{scores} = \@scores; |
| 191 |
|
194 |
|
| 192 |
my $facets = $self->_convert_facets( $results->{aggregations} ); |
195 |
my $facets = $self->_convert_facets( $results->{aggregations} ); |
| 193 |
if ( C4::Context->interface eq 'opac' ) { |
196 |
if ( C4::Context->interface eq 'opac' ) { |