lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Kr├╝ger <>
Subject Boosting by date when only some records have one
Date Sat, 13 Dec 2008 12:22:00 GMT


I'm looking for a way to boost queries by date but not all documents
have a date associated with them. My goal is to have something like a
default boost for documents (e.g. 1.0) with a function for documents
with dates that distribute the boosts between 1.0 - x to 1.0 + x based
on a valid date range.

So far I have not been able to formulate a query that does that. The
query I tried resulted in documents being returned as results, which
without the boost function, weren't returned, which renders it useless.

I have criteria in the schema based which I know if that document is
supposed to be boosted by date or not. So in pseudocode what I wanted to
have is:

if(document.dateField != null){
 boost = somefunction(document.dateField);
} else{
 boost = 1;

or (using another field as criterion)

if(document.hasDateField == 1){
 boost = somefunction(document.dateField);
} else{
 boost = 1;

Any suggestions or sample queries anyone?

Many thanks in advance,


View raw message