hello , i am using this function to update the index ..
private static void insert_index(String url)throws Exception
{
System.out.println(url);
IndexWriter writer = new IndexWriter(
FSDirectory.open(new File(INDEX_DIR)),
new StandardAnalyzer(Version.LUCENE_CURRENT),
true,
IndexWriter.MaxFieldLength.UNLIMITED);
Document doc;
String field;
String text;
doc = new Document();
field = "url";
text = url;
doc.add(new Field(field, text, Field.Store.YES, Field.Index.ANALYZED));
field = "tags";
text = "url";
doc.add(new Field(field, text, Field.Store.YES, Field.Index.ANALYZED));
writer.addDocument(doc);
writer.commit();
writer.close();
}
it index more urls and if i search the field with url it shows only the last indexed url....