Hi I am using Plucene::Index::Writer; for creating the index.
The code is give below how I am creating indexes
print "Content-type:text/html \n\n";
use CGI::Carp qw( fatalsToBrowser );
use Plucene;
use DBI;
use Data::Dumper;
use Plucene::Document;
use Plucene::Document::Field;
use Plucene::Analysis::SimpleAnalyzer;
use Plucene::Index::Writer;
my $analyzer = Plucene::Analysis::SimpleAnalyzer->new();
my $writer = Plucene::Index::Writer->new("doc_index", $analyzer,1);
#database creation my $dbh=DBI->connect('dbi:mysql:username','DB','Password',{RaiseError => 1,AutoCommit => 0}) || die "Database connection not made: $DBI::errstr";
$SQL = "SELECT a,b,c,d,e,f,g,h,i,j,k from tablename;";
$st = $dbh->prepare($SQL) or die "Preparing MySQL query failed: $DBI::errstr";
$st->execute() or die "The execution of the MySQL query failed: $DBI::errstr";
while ($row = $st->fetchrow_hashref()) { my $doc = Plucene::Document->new;
$doc->add(Plucene::Document::Field->Text(a => $row->{a} || 'NUll'));
$doc->add(Plucene::Document::Field->Text(b => $row->{b} || 'Null'));
$doc->add(Plucene::Document::Field->Text(c => $row->{c} || 'Null'));
$doc->add(Plucene::Document::Field->Text(d => $row->{d} || 'Null'));
$doc->add(Plucene::Document::Field->Text(e => $row->{e} || 'Null'));
$doc->add(Plucene::Document::Field->Text(f => $row->{f} || 'Null'));
$doc->add(Plucene::Document::Field->Text(g => $row->{g} || 'Null'));
$writer->add_document($doc);
#writing document to the doc_index folder print Dumper($doc);
} This way I am creating the index when i move into "doc_index" i.e in index directory
I got files something like _1110.f1
_1110.f2
_1110.f3
_1110.f4
_1110.fdt
_1110.fdx
_1110.fnm
_1110.frq
_1110.prx
_1110.tii
_1110.tis now if my database is update how i will link it to my plucene index.
or if I want to update something or delete something how can i tackel it with Plucene::Simple please suggest.
how could i know the $id $plucy->delete_document($id); form the plucene::simple Please suggest

In reply to Re^2: How to update / delete Plucene Index by vijayant kumar
in thread How to update / delete Plucene Index by vijayant kumar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.