Maybe the complexity caused by reuse in this case (a pool of Field
instances) may not be offset by the performance gains of avoiding GC?
You could code up a quick test and see what performance gains it gives
you?
Reuse works very well when your documents are extremely regular.
Mike
Juyal wrote:
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:
http://www.nabble.com/reusing-Document-with-multiple-fields-in-lucene-2.3-tp19220927p19220927.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]