It seems to work for distances lower than ~25km, but on higher distances the score is always 1.
Therefore boosting will have no affect. We tried all possible functions ( linear, proximity, exponential) and in addition higher factors.
Any idea, how to increase the score for distances higher than 30km?
Are you applying the "proximity" boost to a numeric field (distance), or to geolocation? It is, unfortunately, a known issue that proximity boost does not work so great on numbers right now, because it uses a static scale for the decay function, which is good for some but not all cases.
I would say geolocation
based on this code
options["boosts"] = {
location: {
type: "proximity",
function: "exponential",
center: options.facets.location.center,
factor: 10
}
};
where options.facets.location.center is a geopoint
My initial answer (based on the known issue above) was not full. The problem affects both geolocation and numeric fields, because for both of those, AppSearch will not allow you to provide a custom scale value. The default scale, in case of geolocation field type, is set to 1km, and currently there's no way to change it.
We are aware that the user experience with this feature is not great right now, and there probably will be improvements in the future. For right now, unfortunately, there's no good solution.
I found a workaround for this bug. You can divide all your coordinates by a factor. I did factor 1000 for locations all within switzerland (you might even need a bigger factor). Now I get good results for all those locations.
Obviously you also have to divide the center-coordinates.
Is there any way to set the score to 0 or 1 (something const) before calculating the boost? Otherwise i'll allways end up with some kind of mess, because the values get mixed up slightly.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.