ruflin/Elastica — pull request #203 by scottmac (2012-06-26 01:48:45+00:00)
Title: Allow scripts to be used in Elastica_Query_CustomFiltersScore

...filter

Using it like this for changing the score based on the age of a document.

$boosted_query = new Elastica_Query_CustomFiltersScore();
$boosted_query->setQuery($query);
$boosted_query->setParam('score_mode', 'multiply');
$boosted_query->addFilterScript(
new Elastica_Filter_Type('foo'),
"50*exp(1.098e-8*(doc['time_updated'].doubleValue - time()/1000))"
);