pelias / api

HTTP API for Pelias Geocoder
http://pelias.io
MIT License
221 stars 162 forks source link

clamp boundary.circle.radius for reverse queries #1618

Closed missinglink closed 2 years ago

missinglink commented 2 years ago

I noticed that the boundary.circle.radius param is currently unbounded for /v1/reverse. If a users sets this value very high it can result in a lot of disk I/O as ES pages in the docvalues to score all the results.

This PR defines minimum and maximum values for this radius value, I've selected 5km as the max and an arbitrarily low value of 0.00001km for the min; although I'm open to changing either of these.