Hi Hasan,
The issue seems to be with the initialization of the index writer, try
initializing it with a the last parameter as false i.e.
*writer = new IndexWriter(indexLocation, new StandardAnalyzer(), false);
*If you initialize it with the last argument as true, it creates a new
index each time @ the index location.
With the last argument as 'false' you would be able to append data to the
existing index.
Hope that solves the issue.
--
Anshum
On Thu, Apr 24, 2008 at 8:13 AM, Hasan Diwan <[EMAIL PROTECTED]> wrote:
> writer = new IndexWriter(indexLocation, new
> StandardAnalyzer(), true);
> String string = request.getParameter("text");
> this.log("Text is "+string);
> Date date = new Date();
> String dateString = DateTools.dateToString(date,
> DateTools.Resolution.MINUTE);
> this.log("Date is "+dateString);
> Field allField = new Field("all", string, Field.Store.YES,
> Field.Index.TOKENIZED);
> Field dateField = new Field("date", dateString,
> Field.Store.YES,
> Field.Index.UN_TOKENIZED);
> doc.add(allField);
> doc.add(dateField);
> writer.addDocument(doc);
> writer.optimize();
> writer.close();
>
> This code is supposed to get information from a JSP (and does) and put
> it into a lucene index (and does) in a new document (and does not).
> This is apparent when I query it using luke and the default lucene web
> application. Any suggestions or pointers to what to do about this
> would be eternally helpful? Thanks in advance!
> --
> Cheers,
> Hasan Diwan <[EMAIL PROTECTED]>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
--
The facts expressed here belong to everybody, the opinions to me.
The distinction is yours to draw............