From: Bruce F. <Bruce@Fitzsimons.org> - 2006-02-21 09:13:56
|
Ben van Klinken wrote: > Hi Bruce, > > Ok, I guess that's not something that the tests check. Please send me that > file/line if you can - and ideally a small test showing the problem. > Erm. Well technically it is a fault with my program but I can make a case for a little more defensiveness in CLucene. I agree it is a corner case... Calling IndexSearcher::doc(docNumber) on an empty(freshly created) index causes a core. This is because MultiReader::readerIndex returns -1 because MultiReader::subReadersLength == 0. I'd make a case for readerIndex being a little more tolerant of this end case, despite the fact that the user shouldn't be getting non-existent docs from an empty index (cough). FYI the index searching routines work fine in this case... <rules for indexes snipped> Thanks for these, they are v.helpful. > If you are using the cvs version, I'm sure you would have found some memory > leaks, I'm still sorting that out. If you are using a release version, > please see if you can track down the memory leaks - memory leaks usually > happen when the api is used wrongly, or is used differently to any of the > tests that have been written. > I'll beaver away on reproducing some. I'm on CLucene 9.1.0. Cheers, Bruce |