function_score
allows you to combine functions in any arbitrary way. For example, to avoid 0 scores, you can add an arbitrary value 0.001
to your gaussian values by using weight
of 0.001
and score_mode
of sum
:
"function_score" : {
"functions": [
{
"gauss": {
"geo.coordinates": {
"origin": { "lat": 14.18, "lon": -169.67 },
"scale": "2km"
}
}
},
{
"weight" : 0.001
}
],
"score_mode" : "sum"
}
Will this solve your problem?