lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Wedding <>
Subject Function Query does not work properly
Date Wed, 26 Feb 2014 12:44:41 GMT

I have a small problem using function queries. According to and

I've tried using function queries to boost newer documents over older 
ones. For my case, I have documents with dates in the future, so I tried 
to adapt the example: All dates in the future should have a boost 
multiplier of 1. Therefore, I tried using the following function, so all 
dates until 100 years in the future should get a 0 through the map 
function, and all past dates should end up being used as they are after 
the map function, resulting in a boost multiplier of 1 for all future 
dates, and all past dates having the normal values of their age 
according to the recip function:


Unfortunately, this does not seem to work - this function seems to 
return 1 for any date_field value

After that, I tried using a workaround, by emulating the recip function 
using the div and product and sum functions:

This also did not work .

Finally I checked, whether the map function returns correct values, by 
executing the map function alone, so all future days should end up 
having 0 for their score. This DID work.

So my question now: Am I doing something wrong or is there a bug in the 
recip function?

I am currently using Solr 4.5.1.

Thanks for your help,

View raw message