On 8/18/05, Doug Cutting <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]