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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-1 / +1 lines)
Lines 487-493 sub _convert_sort_fields { Link Here
487
        pubdate     => 'pubdate',
487
        pubdate     => 'pubdate',
488
    );
488
    );
489
    my %sort_order_convert =
489
    my %sort_order_convert =
490
      ( qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) );
490
      ( qw( desc desc ), qw( dsc desc ), qw( asc asc ), qw( az asc ), qw( za desc ) );
491
491
492
    # Convert the fields and orders, drop anything we don't know about.
492
    # Convert the fields and orders, drop anything we don't know about.
493
    grep { $_->{field} } map {
493
    grep { $_->{field} } map {
(-)a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t (-11 / +10 lines)
Lines 230-236 subtest 'build_query tests' => sub { Link Here
230
};
230
};
231
231
232
subtest "_convert_sort_fields" => sub {
232
subtest "_convert_sort_fields" => sub {
233
    plan tests => 1;
233
    plan tests => 2;
234
    my @sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_dsc ));
234
    my @sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_dsc ));
235
    is_deeply(
235
    is_deeply(
236
        \@sort_by,
236
        \@sort_by,
Lines 242-254 subtest "_convert_sort_fields" => sub { Link Here
242
    );
242
    );
243
243
244
    # We could expect this to pass, but direction is undef instead of 'desc'
244
    # We could expect this to pass, but direction is undef instead of 'desc'
245
    #@sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_desc ));
245
    @sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_desc ));
246
    #is_deeply(
246
    is_deeply(
247
    #    \@sort_by,
247
        \@sort_by,
248
    #    [
248
        [
249
    #        { field => 'callnum', direction => 'asc' },
249
            { field => 'callnum', direction => 'asc' },
250
    #        { field => 'author',  direction => 'desc' }
250
            { field => 'author',  direction => 'desc' }
251
    #    ],
251
        ],
252
    #    'sort fields should have been split correctly'
252
        'sort fields should have been split correctly'
253
    #);
253
    );
254
};
254
};
255
- 

Return to bug 19564