On 1/14/2013 2:56 PM, Markus Jelsma wrote:
Depending on use case the functions max, min, scale and map can be used really
well to regulate the output of recip. Check their docs and you'll surely work
it out. Perhaps scale will work best for you.
I need someone to sanity check my work here.
Here's my existing boost:
<str name="boost">recip(ms(NOW/DAY,pd),3.16e-11,1,1)</str>
After a careful look at your advice and the functions available, this is
what I have come up with:
min(recip(abs(ms(NOW/HOUR,pd)),3.85e-10,1.25,1),0.625)
To get the second value for the recip function, I figured out how many
milliseconds were in 30 days, then inverted that. If I understand
everything correctly, this will result in boost values from 1.25 for
docs created right now to 0.625 for docs created >= 30 days ago. If I
need to adjust 1.25 to X, then I also need to adjust the 0.625 value to
0.5 times X.
Does that look OK?
Thanks,
Shawn