/[Semantic-Engine]/EPrints/index.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /EPrints/index.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 17 by dpavlin, Sat Jun 30 13:46:51 2007 UTC revision 18 by dpavlin, Mon Jul 2 12:55:49 2007 UTC
# Line 5  use Semantic::API; Line 5  use Semantic::API;
5  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
6    
7  use EPrints qw/_x/;  use EPrints qw/_x/;
8    use KinoSearch::Simple;
9    
10  my $debug = shift @ARGV;  my $debug = shift @ARGV;
11  my $use = {  my $use = {
# Line 40  $indexer->set_default_encoding( "iso-885 Line 41  $indexer->set_default_encoding( "iso-885
41    
42  my $total = 0;  my $total = 0;
43    
44    my $kino = KinoSearch::Simple->new(
45            path => 'kinoindex/',
46            language => 'ru',
47    );
48    
49  while (my $row = $sth->fetchrow_hashref ) {  while (my $row = $sth->fetchrow_hashref ) {
50          my $id = $row->{id};          my $id = $row->{id};
51          EPrints->id( $id );          EPrints->id( $id );
52    
53          my $parts = {          my $parts = {
54                  title => [ _x( $row->{title} ), 3 ],                  title => [ _x( $row->{title} ), 3 ],
55                  keywords => [ EPrints->lookup( 'keywords' ), 2 ],                  keywords => [ EPrints->lookup( 'keywords' ), 2 ],
# Line 86  while (my $row = $sth->fetchrow_hashref Line 93  while (my $row = $sth->fetchrow_hashref
93          }          }
94    
95          $indexer->index( $row->{id}, $body );          $indexer->index( $row->{id}, $body );
96            $kino->add_doc({
97                    id => $id,
98                    title => $parts->{title},
99                    keywords => $parts->{keywords},
100                    abstract => $parts->{abstract},
101            });
102            
103          $total++;          $total++;
104          print STDERR "$total: ", $row->{id}, " ", _x( $row->{title} ), " - ", length($body), " bytes\n";          print STDERR "$total: ", $row->{id}, " ", _x( $row->{title} ), " - ", length($body), " bytes\n";
105  }  }

Legend:
Removed from v.17  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC 1.1.26