SOLR to Elastic NEWEST

Solr to Elastic.

How do I covert:

{!boost b=recip(ms(NOW/HOUR,%s),3.16e-11,%s,%s)}

Which is to sort by NEWEST - want to change this to work on Elastic?

Not sure how to do a dynamic ms(NOW/HOUR) and have low values for 10 years ago, and higher values for times closer to now.

Something like the following with exponentialDecayFunction might work, but the math is making it hard to debug.

new FunctionScoreQueryBuilder.FilterFunctionBuilder(ScoreFunctionBuilders.exponentialDecayFunction(elasticField, new Date().getTime(), scale, 0, .1).setWeight(boost))

bump ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.