The usual fix for this is log(1+qty). If you might have negative values, you 
can use log(max(1,qty)).

wunder
Walter Underwood
wun...@wunderwood.org
http://observer.wunderwood.org/

On Oct 20, 2014, at 3:04 PM, O. Olson <olson_...@yahoo.it> wrote:

> I am considering using a boost as follows: 
> 
> &boost=log(qty)
> 
> Where qty is the quantity in stock of a given product i.e. qty could be 0,
> 1, 2, 3, … etc. The problem I see is that log(0) is -Infinity. Would this be
> a problem for Solr? For me it is not a problem because 
> log(0) < log(1) < log(2) etc. 
> 
> I'd be grateful for any thoughts. One alternative is to use max e.g.
> &boost=max(log(qty), -1) 
> 
> But still this would cause Solr to compute the -Infinity and then discard
> it.  So can I use an expression for boost that would result in –Infinity? 
> 
> Thank you
> O. O.
> 

Reply via email to