Currently, when setting a decay value on a score function, you can only set a value between 0 and 1 exclusively, independently of the score function you're using.
// elasticsearch/server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java
protected DecayFunctionBuilder(String fieldName, Object origin, Object scale, Object offset, double decay) {
if (fieldName == null) {
throw new IllegalArgumentException("decay function: field name must not be null");
}
if (scale == null) {
throw new IllegalArgumentException("decay function: scale must not be null");
}
if (decay <= 0 || decay >= 1.0) {
throw new IllegalStateException("decay function: decay must be in range 0..1!");
}
// ....
This makes sense with gauss and exp score functions, since they use ln(decay) in their formula, and ln(0) does not exist.
But when using linear functions the decay should be allowed to be 0, since the formula would not result in a division by 0.

If you have any suggestions over the best way on how to tackle this, I'm open to go ahead and code it.
Currently, when setting a decay value on a score function, you can only set a value between 0 and 1 exclusively, independently of the score function you're using.
This makes sense with gauss and exp score functions, since they use ln(decay) in their formula, and ln(0) does not exist.

But when using linear functions the decay should be allowed to be 0, since the formula would not result in a division by 0.
If you have any suggestions over the best way on how to tackle this, I'm open to go ahead and code it.