I want to find best movie/webseries from past 6 months to now and it should have good rating also.
POST sample-movie-2022.02.08/_search
{
"query": {
"function_score": {
"functions": [
{
"gauss": {
"rating": {
"origin": "10",
"scale": "1"
}
}
},
{
"gauss": {
"release_date": {
"origin": "now",
"scale": "180d"
}
}
}
]
}
}
}
The query gives different score when i change rating
scale like 1,7,8.I actually don't know what does it mean in rating but i understood origin and scaling in relase_date
You're using a decay functions (i.e. gauss) and the parameters to that function mean:
origin
: the point of origin from where the "distance" is computedoffset
(default 0 as in your case): means that the decay starts right at the origin (i.e. origin ± offset = origin
in your case)scale
: the point at which the function will take the value of decay
(i.e. origin ± offset ± scale
)decay
(default 0.5 as in your case): the score at the scale
point (i.e. the score at origin ± offset ± scale
So, concretely in your case what it means is that:
So the offset and scale parameters allow you to define the inflection point from which the scoring will decay
.