From e84c6a47a07530c35d2540731cde470fb7a9aed5 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Tue, 19 Mar 2013 18:19:31 +0100 Subject: [PATCH] Bug 7440 follow-up removing forgotten NoZebra references Signed-off-by: Paul Poulain --- C4/AuthoritiesMarc.pm | 69 +++++++------------- C4/Search.pm | 8 --- .../prog/en/modules/help/admin/stopwords.tt | 2 - 3 files changed, 23 insertions(+), 56 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 008cfd5..e711e7e 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -328,12 +328,6 @@ counts Usage of Authid in bibliorecords. sub CountUsage { my ($authid) = @_; - if (C4::Context->preference('NoZebra')) { - # Read the index Koha-Auth-Number for this authid and count the lines - my $result = C4::Search::NZanalyse("an=$authid"); - my @tab = split /;/,$result; - return scalar @tab; - } else { ### ZOOM search here my $query; $query= "an:".$authid; @@ -344,7 +338,6 @@ sub CountUsage { } return $result; - } } =head2 CountUsageChildren @@ -1413,46 +1406,30 @@ sub merge { my @reccache; # search all biblio tags using this authority. #Getting marcbiblios impacted by the change. - if (C4::Context->preference('NoZebra')) { - #nozebra way - my $dbh=C4::Context->dbh; - my $rq=$dbh->prepare(qq(SELECT biblionumbers from nozebra where indexname="an" and server="biblioserver" and value="$mergefrom" )); - $rq->execute; - while (my $biblionumbers=$rq->fetchrow){ - my @biblionumbers=split /;/,$biblionumbers; - foreach (@biblionumbers) { - if ($_=~/(\d+),.*/) { - my $marc=GetMarcBiblio($1); - push @reccache,$marc; - } - } - } - } else { - #zebra connection - my $oConnection=C4::Context->Zconn("biblioserver",0); - # We used to use XML syntax here, but that no longer works. - # Thankfully, we don't need it. - my $query; - $query= "an=".$mergefrom; - my $oResult = $oConnection->search(new ZOOM::Query::CCL2RPN( $query, $oConnection )); - my $count = 0; - if ($oResult) { - $count=$oResult->size(); - } - my $z=0; - while ( $z<$count ) { - my $rec; - $rec=$oResult->record($z); - my $marcdata = $rec->raw(); - my $marcrecordzebra= MARC::Record->new_from_usmarc($marcdata); - my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); - my $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield); - my $marcrecorddb=GetMarcBiblio($i); - push @reccache, $marcrecorddb; - $z++; - } - $oResult->destroy(); + #zebra connection + my $oConnection=C4::Context->Zconn("biblioserver",0); + # We used to use XML syntax here, but that no longer works. + # Thankfully, we don't need it. + my $query; + $query= "an=".$mergefrom; + my $oResult = $oConnection->search(new ZOOM::Query::CCL2RPN( $query, $oConnection )); + my $count = 0; + if ($oResult) { + $count=$oResult->size(); + } + my $z=0; + while ( $z<$count ) { + my $rec; + $rec=$oResult->record($z); + my $marcdata = $rec->raw(); + my $marcrecordzebra= MARC::Record->new_from_usmarc($marcdata); + my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); + my $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield); + my $marcrecorddb=GetMarcBiblio($i); + push @reccache, $marcrecorddb; + $z++; } + $oResult->destroy(); #warn scalar(@reccache)." biblios to update"; # Get All candidate Tags for the change # (This will reduce the search scope in marc records). diff --git a/C4/Search.pm b/C4/Search.pm index e2df744..d3d3ce1 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1257,14 +1257,6 @@ sub buildQuery { my $fuzzy_enabled = C4::Context->preference("QueryFuzzy") || 0; my $remove_stopwords = C4::Context->preference("QueryRemoveStopwords") || 0; - # no stemming/weight/fuzzy in NoZebra - if ( C4::Context->preference("NoZebra") ) { - $stemming = 0; - $weight_fields = 0; - $fuzzy_enabled = 0; - $auto_truncation = 0; - } - my $query = $operands[0]; my $simple_query = $operands[0]; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/stopwords.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/stopwords.tt index 05e1640..8078532 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/stopwords.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/stopwords.tt @@ -2,8 +2,6 @@

Stop Words

-

Important: If NoZebra is set to 'Use' this option will not appear on the administration menu

-

Stop words are words that you want the search system to ignore.

Koha comes with a standard list of stop words that can be edited by visiting the Stop Word administration area.

-- 1.7.9.5