10 |
=cut |
=cut |
11 |
|
|
12 |
# create and configure node |
# create and configure node |
13 |
my $node = new Search::Estraier::Node; |
my $node = new Search::Estraier::Node( |
14 |
$node->set_url("http://localhost:1978/node/test"); |
url => 'http://localhost:1978/node/test', |
15 |
$node->set_auth("admin","admin"); |
user => 'admin', |
16 |
|
passwd => 'admin' |
17 |
|
); |
18 |
|
|
19 |
# create document |
# create document |
20 |
my $doc = new Search::Estraier::Document; |
my $doc = new Search::Estraier::Document; |
27 |
$doc->add_text("Somewhere over the rainbow. Way up high."); |
$doc->add_text("Somewhere over the rainbow. Way up high."); |
28 |
$doc->add_text("There's a land that I heard of once in a lullaby."); |
$doc->add_text("There's a land that I heard of once in a lullaby."); |
29 |
|
|
30 |
die "error: ", $node->status,"\n" unless ($node->put_doc($doc)); |
die "error: ", $node->status,"\n" unless (eval { $node->put_doc($doc) }); |
31 |
|
|