Re: best practice for reusing documents with multi-valued fields

2011-04-18 Thread Anshum
Hi Chris, So doc.removeFields works fine, just tried it again. You could try using an approach on the lines of the one mentioned below. *--snip--* IndexWriter iw = new IndexWriter(indexDir, new StandardAnalyzer(Version.LUCENE_30),true, MaxFieldLength.UNLIMITED); Document doc = new Document(); doc

best practice for reusing documents with multi-valued fields

2011-04-14 Thread Christopher Condit
I know that it's best practice to reuse the Document object when indexing, but I'm curious how multi-valued fields affect this. I tried this before indexing each document: doc.removeFields(myMultiValuedField); for (String fieldName: fieldNames) { Field field= doc.getField(field); if (null != f