Custom geo ranking using computed attribut

We are trying to implement a webshop-like page where we show a number of items, allowing the user to filter and sort.

One of the orderings we want to support is the inverse of the product of distance and price, i.e.

1 / (distance * price)

Price here is some attribute provided at the ingestion of the data. Distance however should be based on the geolocation of the user and the location of the data (which is also provided as static data).

I’ve read some stuff about custom ranking and sorting, but so far all I can see is stuff about just adding ranking on single attributes, not a composite / aggregate like I need.

Is what we are trying to accomplish impossible to do in Algolia?
Basically we need is either

  • Parameterized attributes with a computed definition, e.g. (geoLoc) => 1 / (price * (loc - geoLoc))
  • Parameterized ranking expression composing muliple attributes.

Any help is appreciated!