lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Condit <con...@sdsc.edu>
Subject best practice for reusing documents with multi-valued fields
Date Fri, 15 Apr 2011 01:02:56 GMT
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 != field) {
    field.setValue("");
  } else {
    System.out.println("null field");
  }
}

And it seems that the null fields (which I had removed) are just
accumulating. Is there a better way to reuse a document with
multi-valued fields?

Thanks,
-Chris

---------------------------------------------------------------------
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