Cool. Thanks! BTW, I have another issue here. The array of floats for the Float cache is not initialised. Which means that it will return '0.0' (not initialised) as the value for those documents that have a '0' as the value, as well as for those ones that do not have the field. In my actual system I do not want that and I have worked it out by modifying the code from FieldCacheImpl. i suggest it could be defined a (e.g.) NOT_FOUND_FLOAT_VALUE, modifiable, so it does not necessarily have to be 0. And used for initialise the array of floats before processing (or do it on the loop if better performance can be reached). I have set it to Float.NEGATIVE_INFINITY Cheers
Otis Gospodnetic wrote: > > I'm not looking at the code now, but I believe this is because those > Strings are interned, and I believe they are interned precisely so that > this (faster) comparison can be done. > > Otis > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . > . . . > Simpy -- http://www.simpy.com/ - Tag - Search - Share > > ----- Original Message ---- > From: poeta simbolista <[EMAIL PROTECTED]> > To: java-user@lucene.apache.org > Sent: Wednesday, February 14, 2007 12:47:36 PM > Subject: FieldCacheImpl mistake? > > > Hi guys, > I have been diving into the FieldCacheImpl code. > I have seen sth on actual version: > Revision 488908 - (view) (download) (annotate) - [select for diffs] > Modified Wed Dec 20 03:47:09 2006 UTC (8 weeks ago) by yonik > File length: 13425 byte(s) > > that I wonder if it's not totally right, or if it is, I would like to know > why. > > In the creation of eeach cache (Int, Float, String) there is a String > comparison using != instead of equals method: > > if (term==null || term.field() != field) break; > > I hope this can be useful... though i have used the code and it seems to > work perfectly. > Cheers > > > -- > View this message in context: > http://www.nabble.com/FieldCacheImpl-mistake--tf3228683.html#a8969965 > 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] > > > -- View this message in context: http://www.nabble.com/Re%3A-FieldCacheImpl-mistake--tf3228736.html#a8970509 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]