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

(-)a/t/QueryParser.t (+1 lines)
Lines 25-30 is($QParser->target_syntax('biblioserver', 'keyword|publisher:smith'), '@attr 1= Link Here
25
is($QParser->target_syntax('biblioserver', 'ti:"little engine that could"'), '@attr 1=4 @attr 4=1 "little engine that could"', 'phrase query');
25
is($QParser->target_syntax('biblioserver', 'ti:"little engine that could"'), '@attr 1=4 @attr 4=1 "little engine that could"', 'phrase query');
26
is($QParser->target_syntax('biblioserver', 'keyword|titlekw:smith'), '@attr 1=4 @attr 9=20 @attr 2=102 @attr 4=6 "smith"', 'relevance-bumped query');
26
is($QParser->target_syntax('biblioserver', 'keyword|titlekw:smith'), '@attr 1=4 @attr 9=20 @attr 2=102 @attr 4=6 "smith"', 'relevance-bumped query');
27
is($QParser->target_syntax('biblioserver', 'au:smith && johnson'), '@and @attr 1=1003 @attr 4=6 "smith" @attr 1=1003 @attr 4=6 "johnson"', 'query with boolean &&');
27
is($QParser->target_syntax('biblioserver', 'au:smith && johnson'), '@and @attr 1=1003 @attr 4=6 "smith" @attr 1=1003 @attr 4=6 "johnson"', 'query with boolean &&');
28
is($QParser->target_syntax('biblioserver', 'au:smith && ti:johnson'), '@and @attr 1=1003 @attr 4=6 "smith" @attr 1=4 @attr 4=6 "johnson"', 'query with boolean &&');
28
is($QParser->target_syntax('biblioserver', 'au:smith pubdate(-2008)'), '@and @attr 1=1003 @attr 4=6 "smith" @attr 4=4 @attr 1=pubdate @attr 2=2 "2008"', 'keyword search with pubdate limited to -2008');
29
is($QParser->target_syntax('biblioserver', 'au:smith pubdate(-2008)'), '@and @attr 1=1003 @attr 4=6 "smith" @attr 4=4 @attr 1=pubdate @attr 2=2 "2008"', 'keyword search with pubdate limited to -2008');
29
is($QParser->target_syntax('biblioserver', 'au:smith pubdate(2008-)'), '@and @attr 1=1003 @attr 4=6 "smith" @attr 4=4 @attr 1=pubdate @attr 2=4 "2008"', 'keyword search with pubdate limited to 2008-');
30
is($QParser->target_syntax('biblioserver', 'au:smith pubdate(2008-)'), '@and @attr 1=1003 @attr 4=6 "smith" @attr 4=4 @attr 1=pubdate @attr 2=4 "2008"', 'keyword search with pubdate limited to 2008-');
30
is($QParser->target_syntax('biblioserver', 'au:smith pubdate(2008)'), '@and @attr 1=1003 @attr 4=6 "smith" @attr 4=4 @attr 1=pubdate "2008"', 'keyword search with pubdate limited to 2008');
31
is($QParser->target_syntax('biblioserver', 'au:smith pubdate(2008)'), '@and @attr 1=1003 @attr 4=6 "smith" @attr 4=4 @attr 1=pubdate "2008"', 'keyword search with pubdate limited to 2008');
(-)a/t/db_dependent/Search.t (-1 / +13 lines)
Lines 12-18 use YAML; Link Here
12
use C4::Debug;
12
use C4::Debug;
13
require C4::Context;
13
require C4::Context;
14
14
15
use Test::More tests => 194;
15
use Test::More tests => 198;
16
use Test::MockModule;
16
use Test::MockModule;
17
use MARC::Record;
17
use MARC::Record;
18
use File::Spec;
18
use File::Spec;
Lines 451-456 sub run_marc21_search_tests { Link Here
451
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
451
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
452
    is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated multi-faceted search matched right number of records");
452
    is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated multi-faceted search matched right number of records");
453
453
454
    $UseQueryParser = 1;
455
    ( $error, $query, $simple_query, $query_cgi,
456
    $query_desc, $limit, $limit_cgi, $limit_desc,
457
    $stopwords_removed, $query_type ) = buildQuery([], [ 'book' ], [ 'kw' ], [], [], 0, 'en');
458
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
459
    is($results_hashref->{biblioserver}->{hits}, 101, "Search for 'book' with index set to 'kw' returns 101 hits");
460
    ( $error, $query, $simple_query, $query_cgi,
461
    $query_desc, $limit, $limit_cgi, $limit_desc,
462
    $stopwords_removed, $query_type ) = buildQuery([ 'and' ], [ 'book', 'another' ], [ 'kw', 'kw' ], [], [], 0, 'en');
463
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
464
    is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'kw:book && kw:another' returns 1 hit");
465
    $UseQueryParser = 0;
454
466
455
    # FIXME: the availability limit does not actually work, so for the moment we
467
    # FIXME: the availability limit does not actually work, so for the moment we
456
    # are just checking that it behaves consistently
468
    # are just checking that it behaves consistently
(-)a/t/db_dependent/zebra_config.pl (-2 / +3 lines)
Lines 44-50 make_path("$destination/var/run/zebradb"); Link Here
44
$ENV{'INSTALL_BASE'} = $destination;
44
$ENV{'INSTALL_BASE'} = $destination;
45
$ENV{'__INSTALL_BASE__'} = $destination;
45
$ENV{'__INSTALL_BASE__'} = $destination;
46
46
47
my @files = ( "$source/etc/koha-conf.xml" );
47
my @files = ( "$source/etc/koha-conf.xml",
48
              "$source/etc/searchengine/queryparser.yaml",
49
            );
48
50
49
find(sub { push @files, $File::Find::name if ( -f $File::Find::name ); }, "$source/etc/zebradb");
51
find(sub { push @files, $File::Find::name if ( -f $File::Find::name ); }, "$source/etc/zebradb");
50
52
51
- 

Return to bug 11137