lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Spencer <>
Subject Re: TFIDF Implementation
Date Tue, 14 Dec 2004 23:46:37 GMT
Bruce Ritchie wrote:

>>>>From the code I looked at, those calls don't recalculate on 
>>every call. 
>>I was referring to this fragment below from BooksLikeThis.docsLike(), 
>>and was mentioning it as the javadoc 
>>does not say that the values returned by size() and getTerms() are 
>>cached, and while the impl may cache them (haven't checked) it's not 
>>guarenteed, thus it's safer to put the size() and getTerms() call 
>>outside the loop.
>>  for (int j = 0; j < vector.size(); j++) {
>>       TermQuery tq = new TermQuery(
>>           new Term("subject", vector.getTerms()[j]));
> I agree on your overall point that it's probably best to put those calls outside of the
loop, I was just saying that I did look at the implementation and the calls do not recalculate
anything. I'm sorry I didn't explain myself clearly enough.
Oh oh oh, sorry, 10-4, no prob.

> Regards,
> Bruce Ritchie
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message