You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Karl Wettin <ka...@gmail.com> on 2007/10/30 01:51:43 UTC

More about the TermVectorMapper

25 okt 2007 kl. 01.23 skrev Karl Wettin:
>
> The use case is that I want a normalized frequency, and I'd like to  
> do that by loading the factor from an IndexReader in setExpectations.

Moving along in this code, how about passing down the current  
document number to the mapper? Perhaps in setExpectations, perhaps as  
a simple setter method.

Really no big deal to handle that my self via an ad hoc setter  
method, but I think it make sense that the mapper is aware of what  
document it is working with, that the mapper is told when it is used  
for a new/different document.

I reuse a (non thread safe) mapper to go easy on the GC, clearing it  
from data between mappings of different documents. It would be great  
if all that could be handled by the mapper, keeping the calling layer  
of code above that as thin as possible.


-- 
karl


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: More about the TermVectorMapper

Posted by Grant Ingersoll <gs...@apache.org>.
On Oct 29, 2007, at 8:51 PM, Karl Wettin wrote:

>
> 25 okt 2007 kl. 01.23 skrev Karl Wettin:
>>
>> The use case is that I want a normalized frequency, and I'd like to  
>> do that by loading the factor from an IndexReader in setExpectations.
>
> Moving along in this code, how about passing down the current  
> document number to the mapper? Perhaps in setExpectations, perhaps  
> as a simple setter method.
>
> Really no big deal to handle that my self via an ad hoc setter  
> method, but I think it make sense that the mapper is aware of what  
> document it is working with, that the mapper is told when it is used  
> for a new/different document.
>

Seems reasonable, feel free to submit a patch.  Not sure if we need to  
worry too much back-compatibility, since it hasn't been released.



---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org