From bd5bff8a7cb1ea53ab2a75dbb4edbaad3ee80917 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Mon, 14 Jan 2019 16:01:32 +0100 Subject: [PATCH] Bug 20589: Remove QueryWeightFields syspref since no longer in use --- C4/UsageStats.pm | 1 - installer/data/mysql/sysprefs.sql | 1 - installer/data/mysql/updatedatabase.pl | 1 - t/db_dependent/Search.t | 19 ++++++------------- t/db_dependent/UsageStats.t | 1 - 5 files changed, 6 insertions(+), 17 deletions(-) diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 4f66111cd2..1f626d8f1b 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -302,7 +302,6 @@ sub BuildReport { QueryAutoTruncate QueryFuzzy QueryStemming - QueryWeightFields TraceCompleteSubfields TraceSubjectSubdivisions UseICU diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 0a983e35ef..d2b0e3068c 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -475,7 +475,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'), ('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'), ('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'), -('QueryWeightFields','1',NULL,'If ON, enables field weighting','YesNo'), ('QuoteOfTheDay','0',NULL,'Enable or disable display of Quote of the Day on the OPAC home page','YesNo'), ('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'), ('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4f76b76b9b..b78c17cc1a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -740,7 +740,6 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryStemming',1,'If ON, enables query stemming',NULL,'YesNo')"); $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryFuzzy',1,'If ON, enables fuzzy option for searches',NULL,'YesNo')"); -$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryWeightFields',1,'If ON, enables field weighting',NULL,'YesNo')"); $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo')"); $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')"); $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')"); diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 4ef1ebe4d6..437e5cdf7f 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -95,7 +95,6 @@ END { our $QueryStemming = 0; our $QueryAutoTruncate = 0; -our $QueryWeightFields = 0; our $QueryFuzzy = 0; our $UseQueryParser = 0; our $SearchEngine = 'Zebra'; @@ -114,8 +113,6 @@ $contextmodule->mock('preference', sub { return $QueryStemming; } elsif ($pref eq 'QueryAutoTruncate') { return $QueryAutoTruncate; - } elsif ($pref eq 'QueryWeightFields') { - return $QueryWeightFields; } elsif ($pref eq 'QueryFuzzy') { return $QueryFuzzy; } elsif ($pref eq 'UseQueryParser') { @@ -257,7 +254,6 @@ sub run_marc21_search_tests { # set search syspreferences to a known starting point $QueryStemming = 0; $QueryAutoTruncate = 0; - $QueryWeightFields = 0; $QueryFuzzy = 0; $UseQueryParser = 0; $marcflavour = 'MARC21'; @@ -535,7 +531,6 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CQL author search for Lessig returned proper number of matches"); $QueryStemming = $QueryAutoTruncate = $QueryFuzzy = 0; - $QueryWeightFields = 1; ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $query_type ) = buildQuery([], [ 'salud' ], [ 'kw' ], [], [], 0, 'en'); @@ -544,7 +539,7 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); 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"); - $QueryStemming = $QueryWeightFields = $QueryFuzzy = 0; + $QueryStemming = $QueryFuzzy = 0; $QueryAutoTruncate = 1; ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, @@ -561,20 +556,19 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation on"); $QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0; - $QueryWeightFields = 1; ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $query_type ) = buildQuery([], [ 'web application' ], [ 'kw' ], [], [], 0, 'en'); ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); - is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web application' returns one hit with QueryWeightFields on"); + is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web application' returns one hit"); ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $query_type ) = buildQuery([], [ 'web "application' ], [ 'kw' ], [], [], 0, 'en'); ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); - is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web \"application' returns one hit with QueryWeightFields on (bug 7518)"); + is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web \"application' returns one hit"); - $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0; + $QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0; ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en'); @@ -589,7 +583,7 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation off"); - $QueryStemming = $QueryWeightFields = 1; + $QueryStemming = 1; $QueryFuzzy = $QueryAutoTruncate = 0; ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, @@ -598,7 +592,7 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 7, "Search for 'pressed' returns matches when stemming (and query weighting) is on"); - $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0; + $QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0; ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en'); @@ -898,7 +892,6 @@ sub run_unimarc_search_tests { # set search syspreferences to a known starting point $QueryStemming = 0; $QueryAutoTruncate = 0; - $QueryWeightFields = 0; $QueryFuzzy = 0; $UseQueryParser = 0; $marcflavour = 'UNIMARC'; diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index 9d11af1674..79604f7144 100644 --- a/t/db_dependent/UsageStats.t +++ b/t/db_dependent/UsageStats.t @@ -556,7 +556,6 @@ sub mocking_systempreferences_to_a_set_value { QueryAutoTruncate QueryFuzzy QueryStemming - QueryWeightFields TraceCompleteSubfields TraceSubjectSubdivisions UseICU -- 2.11.0