gzip -dc qdbm-1.8.78.tar.gz | tar xf - gzip -dc hyperestraier-1.4.13.tar.gz | tar xf - cd qdbm-1.8.78 env CPATH=/virtual/[user-id]/exec/include LIBRARY_PATH=/virtual/[user-id]/exec/lib LD_LIBRARY_PATH=/virtual/[user-id]/exec/lib:/usr/lib:/usr/local/lib ./configure --prefix=/virtual/[user-id]/exec --exec-prefix=/virtual/[user-id]/exec env CPATH=/virtual/[user-id]/exec/include LIBRARY_PATH=/virtual/[user-id]/exec/lib LD_LIBRARY_PATH=/virtual/[user-id]/exec/lib:/usr/lib:/usr/local/lib make make install cd ../hyperestraier-1.4.13 env CPATH=/virtual/[user-id]/exec/include LIBRARY_PATH=/virtual/[user-id]/exec/lib LD_LIBRARY_PATH=/virtual/[user-id]/exec/lib:/usr/lib:/usr/local/lib ./configure --prefix=/virtual/[user-id]/exec --exec-prefix=/virtual/[user-id]/exec env CPATH=/virtual/[user-id]/exec/include LIBRARY_PATH=/virtual/[user-id]/exec/lib LD_LIBRARY_PATH=/virtual/[user-id]/exec/lib:/usr/lib:/usr/local/lib make make install cd perlnative env CPATH=/virtual/[user-id]/exec/include LIBRARY_PATH=/virtual/[user-id]/exec/lib LD_LIBRARY_PATH=/virtual/[user-id]/exec/lib:/usr/lib:/usr/local/lib ./configure --prefix=/virtual/[user-id]/exec --exec-prefix=/virtual/[user-id]/exec env CPATH=/virtual/[user-id]/exec/include LIBRARY_PATH=/virtual/[user-id]/exec/lib LD_LIBRARY_PATH=/virtual/[user-id]/exec/lib:/usr/lib:/usr/local/lib make make install
use lib '/virtual/[user-id]/exec/lib/perl5/site_perl/5.8.8/i686-linux'; use Estraier; my @l = ( { u => 'http://localhost/01.html', t => 'test1', d => '2012-01-01T12:00:00+09:00', b => 'あえいうえおあお かけきくけこかこ させしすせそさそ', }, { u => 'http://localhost/02.html', t => 'test2', d => '2012-01-02T12:00:00+09:00', b => 'たてちつてとたと なねにぬねのなの はへひふへほはほ', }, ); # data my $d = new Database; $d->open('search_db',Database::DBWRITER | Database::DBCREAT); foreach(@l){ my $o = new Document; $o->add_attr('@uri' ,$_->{'u'}); $o->add_attr('@title',$_->{'t'}); $o->add_attr('@cdate',$_->{'d'}); $o->add_attr('@mdate',$_->{'d'}); $o->add_text($_->{'u'}); # ??? $o->add_text($_->{'t'}); # ??? $o->add_text($_->{'b'}); $d->put_doc($o,Database::PDCLEAN); } $d->close;
use lib '/virtual/[user-id]/exec/lib/perl5/site_perl/5.8.8/i686-linux'; use Estraier; my $q = 'あお'; # query my $d = new Database; $d->open('search_db',Database::DBREADER); my $c = new Condition; $c->set_phrase($q); my $r = $d->search($c); foreach(0 .. ($r->doc_num - 1) ){ my $o = $d->get_doc( $r->get_doc_id($_) ,0); print 'u:'.$o->attr('@uri') ."\n"; print 't:'.$o->attr('@title')."\n"; print 'd:'.$o->attr('@mdate')."\n"; my $t = $o->texts; shift(@$t); shift(@$t); print 'b:'.$t->[0]."\n\n"; } $d->close;