Backend: Increase location search radius to from 5 to 7

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-01-17 02:41:35 +01:00
parent 63d8aedfbe
commit 492a9839ff

View file

@ -49,10 +49,10 @@ func (s *Repo) Geo(f form.GeoSearch) (results []GeoResult, err error) {
}
if f.S2 != "" {
s2Min, s2Max := s2.Range(f.S2, 5)
s2Min, s2Max := s2.Range(f.S2, 7)
q = q.Where("photos.location_id BETWEEN ? AND ?", s2Min, s2Max)
} else if f.Olc != "" {
s2Min, s2Max := s2.Range(pluscode.S2(f.Olc), 5)
s2Min, s2Max := s2.Range(pluscode.S2(f.Olc), 7)
q = q.Where("photos.location_id BETWEEN ? AND ?", s2Min, s2Max)
} else {
// Inaccurate distance search, but probably 'good enough' for now