[Koha-cvs] CVS: koha/C4 Biblio.pm,1.93,1.94

Paul POULAIN tipaul at users.sourceforge.net
Thu Jun 17 10:16:35 CEST 2004


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11460/C4

Modified Files:
	Biblio.pm 
Log Message:
merging tag & subfield in marc_word for better perfs

Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -r1.93 -r1.94
*** Biblio.pm	11 Jun 2004 15:38:06 -0000	1.93
--- Biblio.pm	17 Jun 2004 08:16:32 -0000	1.94
***************
*** 552,556 ****
  		my $itemtag = $sth->fetchrow_hashref->{tagfield};
  		$dbh->do("delete from marc_subfield_table where bibid=$bibid and tag<>$itemtag");
! 		$dbh->do("delete from marc_word where bibid=$bibid and tag<>$itemtag");
  	} else {
  		$dbh->do("delete from marc_biblio where bibid=$bibid");
--- 552,556 ----
  		my $itemtag = $sth->fetchrow_hashref->{tagfield};
  		$dbh->do("delete from marc_subfield_table where bibid=$bibid and tag<>$itemtag");
! 		$dbh->do("delete from marc_word where bibid=$bibid and not (tagsubfield like \"$itemtag%\")");
  	} else {
  		$dbh->do("delete from marc_biblio where bibid=$bibid");
***************
*** 948,953 ****
      my @words = split / /,$sentence;
      my $stopwords= C4::Context->stopwords;
!     my $sth=$dbh->prepare("insert into marc_word (bibid, tag, tagorder, subfieldid, subfieldorder, word, sndx_word)
! 			values (?,?,?,?,?,?,soundex(?))");
      foreach my $word (@words) {
  # we record only words one char long and not in stopwords hash
--- 948,953 ----
      my @words = split / /,$sentence;
      my $stopwords= C4::Context->stopwords;
!     my $sth=$dbh->prepare("insert into marc_word (bibid, tagsubfield, tagorder, subfieldorder, word, sndx_word)
! 			values (?,concat(?,?),?,?,?,soundex(?))");
      foreach my $word (@words) {
  # we record only words one char long and not in stopwords hash
***************
*** 955,959 ****
  	    $sth->execute($bibid,$tag,$tagorder,$subfieldid,$subfieldorder,$word,$word);
  	    if ($sth->err()) {
! 		warn "ERROR ==> insert into marc_word (bibid, tag, tagorder, subfieldid, subfieldorder, word, sndx_word) values ($bibid,$tag,$tagorder,$subfieldid,$subfieldorder,$word,soundex($word))\n";
  	    }
  	}
--- 955,959 ----
  	    $sth->execute($bibid,$tag,$tagorder,$subfieldid,$subfieldorder,$word,$word);
  	    if ($sth->err()) {
! 		warn "ERROR ==> insert into marc_word (bibid, tagsubfield, tagorder, subfieldorder, word, sndx_word) values ($bibid,concat($tag,$subfieldid),$tagorder,$subfieldorder,$word,soundex($word))\n";
  	    }
  	}
***************
*** 964,969 ****
  # delete words. this sub deletes all the words from a sentence. a subfield modif is done by a delete then a add
      my ($dbh,$bibid,$tag,$tagorder,$subfield,$subfieldorder) = @_;
!     my $sth=$dbh->prepare("delete from marc_word where bibid=? and tag=? and tagorder=? and subfieldid=? and subfieldorder=?");
!     $sth->execute($bibid,$tag,$tagorder,$subfield,$subfieldorder);
  }
  
--- 964,969 ----
  # delete words. this sub deletes all the words from a sentence. a subfield modif is done by a delete then a add
      my ($dbh,$bibid,$tag,$tagorder,$subfield,$subfieldorder) = @_;
!     my $sth=$dbh->prepare("delete from marc_word where bibid=? and tagsubfield=concat(?,?) and tagorder=? and subfieldorder=?");
!     $sth->execute($bibid,$tag,$subfield,$tagorder,$subfieldorder);
  }
  
***************
*** 2192,2195 ****
--- 2192,2198 ----
  # $Id$
  # $Log$
+ # Revision 1.94  2004/06/17 08:16:32  tipaul
+ # merging tag & subfield in marc_word for better perfs
+ #
  # Revision 1.93  2004/06/11 15:38:06  joshferraro
  # Changes MARCaddword to index words >= 1 char ... needed for more accurate





More information about the Koha-cvs mailing list