/[Search-Estraier]/trunk/scripts/example_indexer.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

Contents of /trunk/scripts/example_indexer.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 68 - (show annotations)
Sun Jan 8 00:13:09 2006 UTC (18 years, 3 months ago) by dpavlin
File MIME type: text/plain
File size: 695 byte(s)
two simple examples included under synopsis in documentation
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Search::Estraier;
5
6 =head1 NAME
7
8 example_indexer.pl - example indexer for Search::Estraier
9
10 =cut
11
12 # create and configure node
13 my $node = new Search::Estraier::Node;
14 $node->set_url("http://localhost:1978/node/test");
15 $node->set_auth("admin","admin");
16
17 # create document
18 my $doc = new Search::Estraier::Document;
19
20 # add attributes
21 $doc->add_attr('@uri', "http://estraier.gov/example.txt");
22 $doc->add_attr('@title', "Over the Rainbow");
23
24 # add body text to document
25 $doc->add_text("Somewhere over the rainbow. Way up high.");
26 $doc->add_text("There's a land that I heard of once in a lullaby.");
27
28 die "error: ", $node->status,"\n" unless ($node->put_doc($doc));
29

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26