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

(-)a/C4/UsageStats.pm (-1 lines)
Lines 302-308 sub BuildReport { Link Here
302
        QueryAutoTruncate
302
        QueryAutoTruncate
303
        QueryFuzzy
303
        QueryFuzzy
304
        QueryStemming
304
        QueryStemming
305
        QueryWeightFields
306
        TraceCompleteSubfields
305
        TraceCompleteSubfields
307
        TraceSubjectSubdivisions
306
        TraceSubjectSubdivisions
308
        UseICU
307
        UseICU
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 475-481 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
475
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
475
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
476
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
476
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
477
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
477
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
478
('QueryWeightFields','1',NULL,'If ON, enables field weighting','YesNo'),
479
('QuoteOfTheDay','0',NULL,'Enable or disable display of Quote of the Day on the OPAC home page','YesNo'),
478
('QuoteOfTheDay','0',NULL,'Enable or disable display of Quote of the Day on the OPAC home page','YesNo'),
480
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
479
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
481
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
480
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (-1 lines)
Lines 740-746 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
740
740
741
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryStemming',1,'If ON, enables query stemming',NULL,'YesNo')");
741
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryStemming',1,'If ON, enables query stemming',NULL,'YesNo')");
742
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryFuzzy',1,'If ON, enables fuzzy option for searches',NULL,'YesNo')");
742
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryFuzzy',1,'If ON, enables fuzzy option for searches',NULL,'YesNo')");
743
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryWeightFields',1,'If ON, enables field weighting',NULL,'YesNo')");
744
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo')");
743
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo')");
745
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'free')");
744
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'free')");
746
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'free')");
745
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'free')");
(-)a/t/db_dependent/Search.t (-13 / +6 lines)
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';
(-)a/t/db_dependent/UsageStats.t (-2 lines)
Lines 556-562 sub mocking_systempreferences_to_a_set_value { Link Here
556
        QueryAutoTruncate
556
        QueryAutoTruncate
557
        QueryFuzzy
557
        QueryFuzzy
558
        QueryStemming
558
        QueryStemming
559
        QueryWeightFields
560
        TraceCompleteSubfields
559
        TraceCompleteSubfields
561
        TraceSubjectSubdivisions
560
        TraceSubjectSubdivisions
562
        UseICU
561
        UseICU
563
- 

Return to bug 20589