Since my field to measure recency is not a date field but a string field
(with only year-numbers in it), I tried a variation on the suggested
boost function for recent documents:
  recip(sub(2015,min(sortyear,2015)),1,10,10)
But this gives an exception when used in a boost or bf parameter.
I guess the reason is that all the mathematics doesn't work with a
string field even if it only contains numbers. Am I right with this
guess? And if so, is there a function I can use to change the type to
something numeric? Or are there other problems with my function?

Another related question: as you can see the current year (2015) is hard
coded. Is there an easy way to get the current year within the function?
Messing around with NOW looks very complicated.

-Michael

Reply via email to