lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hasan Diwan" <hasan.di...@gmail.com>
Subject Unable to add more than 1 document to Index
Date Thu, 24 Apr 2008 02:43:56 GMT
                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 <hasan.diwan@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message