lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: Adding clear() to Document
Date Wed, 20 May 2009 20:01:34 GMT
On Wed, May 20, 2009 at 3:27 PM, Shai Erera <serera@gmail.com> wrote:
> I noticed Document does not have a clear() method, to remove all the Fields
> set on it.

Document's state is so simple (a List and a boost), reuse doesn't seem worth it.
What if, instead, we allowed the List to be passed into via Document's
constructor?

To put it into perspective, the Document object then becomes lighter
weight than the String object (provided the user is caching the List
of fields).  And really, I think caching the list of fields is even
overboard for pretty much all of the applications out there - I doubt
it would ever be significant given how much relative work is needed to
index a document.

-Yonik
http://www.lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message