Lines 95-101
END {
Link Here
|
95 |
|
95 |
|
96 |
our $QueryStemming = 0; |
96 |
our $QueryStemming = 0; |
97 |
our $QueryAutoTruncate = 0; |
97 |
our $QueryAutoTruncate = 0; |
98 |
our $QueryWeightFields = 0; |
|
|
99 |
our $QueryFuzzy = 0; |
98 |
our $QueryFuzzy = 0; |
100 |
our $UseQueryParser = 0; |
99 |
our $UseQueryParser = 0; |
101 |
our $SearchEngine = 'Zebra'; |
100 |
our $SearchEngine = 'Zebra'; |
Lines 114-121
$contextmodule->mock('preference', sub {
Link Here
|
114 |
return $QueryStemming; |
113 |
return $QueryStemming; |
115 |
} elsif ($pref eq 'QueryAutoTruncate') { |
114 |
} elsif ($pref eq 'QueryAutoTruncate') { |
116 |
return $QueryAutoTruncate; |
115 |
return $QueryAutoTruncate; |
117 |
} elsif ($pref eq 'QueryWeightFields') { |
|
|
118 |
return $QueryWeightFields; |
119 |
} elsif ($pref eq 'QueryFuzzy') { |
116 |
} elsif ($pref eq 'QueryFuzzy') { |
120 |
return $QueryFuzzy; |
117 |
return $QueryFuzzy; |
121 |
} elsif ($pref eq 'UseQueryParser') { |
118 |
} elsif ($pref eq 'UseQueryParser') { |
Lines 257-263
sub run_marc21_search_tests {
Link Here
|
257 |
# set search syspreferences to a known starting point |
254 |
# set search syspreferences to a known starting point |
258 |
$QueryStemming = 0; |
255 |
$QueryStemming = 0; |
259 |
$QueryAutoTruncate = 0; |
256 |
$QueryAutoTruncate = 0; |
260 |
$QueryWeightFields = 0; |
|
|
261 |
$QueryFuzzy = 0; |
257 |
$QueryFuzzy = 0; |
262 |
$UseQueryParser = 0; |
258 |
$UseQueryParser = 0; |
263 |
$marcflavour = 'MARC21'; |
259 |
$marcflavour = 'MARC21'; |
Lines 535-541
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
535 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CQL author search for Lessig returned proper number of matches"); |
531 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CQL author search for Lessig returned proper number of matches"); |
536 |
|
532 |
|
537 |
$QueryStemming = $QueryAutoTruncate = $QueryFuzzy = 0; |
533 |
$QueryStemming = $QueryAutoTruncate = $QueryFuzzy = 0; |
538 |
$QueryWeightFields = 1; |
|
|
539 |
( $error, $query, $simple_query, $query_cgi, |
534 |
( $error, $query, $simple_query, $query_cgi, |
540 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
535 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
541 |
$query_type ) = buildQuery([], [ 'salud' ], [ 'kw' ], [], [], 0, 'en'); |
536 |
$query_type ) = buildQuery([], [ 'salud' ], [ 'kw' ], [], [], 0, 'en'); |
Lines 544-550
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
544 |
is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); |
539 |
is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); |
545 |
is(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first"); |
540 |
is(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first"); |
546 |
|
541 |
|
547 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = 0; |
542 |
$QueryStemming = $QueryFuzzy = 0; |
548 |
$QueryAutoTruncate = 1; |
543 |
$QueryAutoTruncate = 1; |
549 |
( $error, $query, $simple_query, $query_cgi, |
544 |
( $error, $query, $simple_query, $query_cgi, |
550 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
545 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
Lines 561-580
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
561 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation on"); |
556 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation on"); |
562 |
|
557 |
|
563 |
$QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0; |
558 |
$QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0; |
564 |
$QueryWeightFields = 1; |
|
|
565 |
( $error, $query, $simple_query, $query_cgi, |
559 |
( $error, $query, $simple_query, $query_cgi, |
566 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
560 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
567 |
$query_type ) = buildQuery([], [ 'web application' ], [ 'kw' ], [], [], 0, 'en'); |
561 |
$query_type ) = buildQuery([], [ 'web application' ], [ 'kw' ], [], [], 0, 'en'); |
568 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
562 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
569 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web application' returns one hit with QueryWeightFields on"); |
563 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web application' returns one hit"); |
570 |
|
564 |
|
571 |
( $error, $query, $simple_query, $query_cgi, |
565 |
( $error, $query, $simple_query, $query_cgi, |
572 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
566 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
573 |
$query_type ) = buildQuery([], [ 'web "application' ], [ 'kw' ], [], [], 0, 'en'); |
567 |
$query_type ) = buildQuery([], [ 'web "application' ], [ 'kw' ], [], [], 0, 'en'); |
574 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
568 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
575 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web \"application' returns one hit with QueryWeightFields on (bug 7518)"); |
569 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web \"application' returns one hit"); |
576 |
|
570 |
|
577 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0; |
571 |
$QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0; |
578 |
( $error, $query, $simple_query, $query_cgi, |
572 |
( $error, $query, $simple_query, $query_cgi, |
579 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
573 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
580 |
$query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en'); |
574 |
$query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en'); |
Lines 589-595
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
589 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
583 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
590 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation off"); |
584 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation off"); |
591 |
|
585 |
|
592 |
$QueryStemming = $QueryWeightFields = 1; |
586 |
$QueryStemming = 1; |
593 |
$QueryFuzzy = $QueryAutoTruncate = 0; |
587 |
$QueryFuzzy = $QueryAutoTruncate = 0; |
594 |
( $error, $query, $simple_query, $query_cgi, |
588 |
( $error, $query, $simple_query, $query_cgi, |
595 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
589 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
Lines 598-604
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
598 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
592 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
599 |
is($results_hashref->{biblioserver}->{hits}, 7, "Search for 'pressed' returns matches when stemming (and query weighting) is on"); |
593 |
is($results_hashref->{biblioserver}->{hits}, 7, "Search for 'pressed' returns matches when stemming (and query weighting) is on"); |
600 |
|
594 |
|
601 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0; |
595 |
$QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0; |
602 |
( $error, $query, $simple_query, $query_cgi, |
596 |
( $error, $query, $simple_query, $query_cgi, |
603 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
597 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
604 |
$query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en'); |
598 |
$query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en'); |
Lines 898-904
sub run_unimarc_search_tests {
Link Here
|
898 |
# set search syspreferences to a known starting point |
892 |
# set search syspreferences to a known starting point |
899 |
$QueryStemming = 0; |
893 |
$QueryStemming = 0; |
900 |
$QueryAutoTruncate = 0; |
894 |
$QueryAutoTruncate = 0; |
901 |
$QueryWeightFields = 0; |
|
|
902 |
$QueryFuzzy = 0; |
895 |
$QueryFuzzy = 0; |
903 |
$UseQueryParser = 0; |
896 |
$UseQueryParser = 0; |
904 |
$marcflavour = 'UNIMARC'; |
897 |
$marcflavour = 'UNIMARC'; |