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 / +14 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 => 196;
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 458-463 sub run_marc21_search_tests { Link Here
458
    is($results_hashref->{biblioserver}->{hits}, 12,
458
    is($results_hashref->{biblioserver}->{hits}, 12,
459
       'search using index whose name contains "ns" returns expected results (bug 10271)');
459
       'search using index whose name contains "ns" returns expected results (bug 10271)');
460
460
461
    $UseQueryParser = 1;
462
    ( $error, $query, $simple_query, $query_cgi,
463
    $query_desc, $limit, $limit_cgi, $limit_desc,
464
    $stopwords_removed, $query_type ) = buildQuery([], [ 'book' ], [ 'kw' ], [], [], 0, 'en');
465
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
466
    is($results_hashref->{biblioserver}->{hits}, 101, "Search for 'book' with index set to 'kw' returns 101 hits");
467
    ( $error, $query, $simple_query, $query_cgi,
468
    $query_desc, $limit, $limit_cgi, $limit_desc,
469
    $stopwords_removed, $query_type ) = buildQuery([ 'and' ], [ 'book', 'another' ], [ 'kw', 'kw' ], [], [], 0, 'en');
470
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
471
    is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'kw:book && kw:another' returns 1 hit");
472
    $UseQueryParser = 0;
473
461
    # FIXME: the availability limit does not actually work, so for the moment we
474
    # FIXME: the availability limit does not actually work, so for the moment we
462
    # are just checking that it behaves consistently
475
    # are just checking that it behaves consistently
463
    ( $error, $query, $simple_query, $query_cgi,
476
    ( $error, $query, $simple_query, $query_cgi,
(-)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