lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunjan Juyal <>
Subject reusing Document with multiple fields in lucene 2.3
Date Fri, 29 Aug 2008 14:22:44 GMT

Hello all!
 I have a document structure such that each document can have multiple and
variable number of fields of a given name. For example:
- Document-1 has two fields with the name "fld1" and three fields with the
name "fld2";
- Document-2 has five fields with the name "fld1" and one field with the
name "fld2".

 If a document has a fixed number of fields then it's easy to reuse the
field instances by setting them to different values before writing the doc,
but I can't think of any way in which I can reuse the document or field
instances in this case (where the number of fields varies from document to
document). One possibility is to maintain a pool of fields, create a new
instance for each document and add the already-existing fields to the new
doc after setting them to an appropriate value. But this would require
significant additions to the code.

 Has anyone else faced such a situation? I'd be glad if someone could give
any pointers for this situation! Thanks in anticipation!

- Gunjan
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message