I am using lucene to index rows in a spreadsheet , each row is a Document, and the document indexes 10 fields from the row plus the row number used to relate thethe Document to the row number So when someone modifies one of the 10 fields I am interested in a row I have to update the document with the new data

writer = new IndexWriter(directory, analyzer);
Document document = createDocument(row);
writer.updateDocument(new Term(ROW_NUMBER, "" + row), document);
writer.optimize();
writer.close();

Because I can't retrieve the existing Document for a row from a writer I recreate the document when one of the values has changed, but this means I have to go off and get all the values again even though I am only changing one. is there a better way to do this, I thought that I could retrive the document using an IndexReader and then modify it using removeField(),AddField() but there is extra overhead in doing in having to create a reader to get the document - so which would be best.

thanks Paul



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

Reply via email to