lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris D <bro...@gmail.com>
Subject Re: Indexing document instances and retrieving instance attributes
Date Mon, 22 Aug 2005 21:18:52 GMT
On 8/18/05, Doug Cutting <cutting@apache.org> wrote:
> Chris D wrote:
> > Well in my case field order is important, but the order of the
> > individual fields isn't. So I can speed up getFields to roughly O(1)
> > by implementing Document as follows.
> 
> Have you actually found getFields to be a performance bottleneck in your
> application?  I'd be surprised if it was.  If it isn't, then this looks
> like a premature optimization.
> 
> Doug

I did actually, mind you my index is a little strange in that there
may be 1000 fields or so sometimes (Which is why I started this thread
to begin with :-)). But when I do a getFields("author") for each hit,
it would have to iterate through all of the fields for every hit... So
for 100 hits it iterates through all 1000 fields everytime that's a
total of 100000 iterations. If the number of hits get reasonably large
it might take a fair amount of time. I don't have a test case proving
an actual time benefit but I could probably write one tomorrow if you
think it would be interesting. (It's the end of the work day here so
I'm going home now to non-lucene activities)

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