Bertrand Delacretaz wrote:
On 3/12/07, stefano nicolai <[EMAIL PROTECTED]> wrote:
...All of these items have a field containing the date they were created
(it's a string field at the moment, as i have this type inside my DB).
I want to give a higher score to the ones with the most recent date...
You should be able to use boost functions for this, see for example
http://www.mail-archive.com/solr-user@lucene.apache.org/msg01877.html
and
http://lucene.apache.org/solr/api/org/apache/solr/search/QueryParsing.html#parseFunction(java.lang.String,%20org.apache.solr.schema.IndexSchema)
-Bertrand
Thanks for the answer, I'm trying to play with the linear/recip
functions to get the results i want.
Reading the old threads i ended up in this link with a different solution:
http://www.gossamer-threads.com/lists/lucene/java-user/43457
What you think about Andrej's idea (copy/pasted here)?
"Add a separate field, say "days", in which you will put as many "1" as
many days elapsed since the epoch (not neccessarily since 1 Jan 1970 -
pick a date that makes sense for you). Then, if you want to prioritize
newer documents, just add "+days:1" to your query. Voila - the final
results are a sum of other score factors plus a score factor that is
higher for more recent document, containing more 1-s"
I'm just wondering if this way may boost the date field too much
compared to the other fields?