-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Allow different decay values depending on the score function #78887
Copy link
Copy link
Closed
Labels
:Search Relevance/RankingScoring, rescoring, rank evaluation.Scoring, rescoring, rank evaluation.>enhancementTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearch
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Search Relevance/RankingScoring, rescoring, rank evaluation.Scoring, rescoring, rank evaluation.>enhancementTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearch
Type
Fields
Give feedbackNo fields configured for issues without a type.