Is it possible to use a painless script for search?
I’m thinking to move from ES to Mongo Atlas, but i kind of need some flexibility with my queries.
One example is:
I need to find nearby stores to my customers, but the store has the possibility to define the max distance it will delivery.
And i’m using this script in ES for it.
Is it possible to do that with atlas search?
script: {
script: {
source: "doc['location'].arcDistance(params.lat, params.lon) / 1000 < doc['marketplace.distanceRadius'].value",
lang: 'painless',
params: {
lat: Number(body.lat),
lon: Number(body.lon),
}
}
}