Skip to content

Commit

Permalink
Merge pull request #62 from geoadmin/develop
Browse files Browse the repository at this point in the history
New Release v1.10.0 - #minor
  • Loading branch information
rebert authored Mar 18, 2024
2 parents efa2cf3 + 2d4a575 commit 99f2093
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ def _swiss_search(self): # pylint: disable=too-many-branches, too-many-statemen
coords = self._get_geoanchor_from_bbox()
self.sphinx.SetGeoAnchor('lat', 'lon', coords[1], coords[0]) # pylint: disable=unsubscriptable-object
self.sphinx.SetSortMode(sphinxapi.SPH_SORT_EXTENDED, '@geodist ASC')
limit = self.BBOX_SEARCH_LIMIT
limit = self.limit if self.limit and \
self.limit <= self.BBOX_SEARCH_LIMIT else self.BBOX_SEARCH_LIMIT
logger.debug("SetGeoAnchor lat = %s, lon = %s", coords[1], coords[0]) # pylint: disable=unsubscriptable-object
else:
self.sphinx.SetRankingMode(sphinxapi.SPH_RANK_WORDCOUNT)
Expand Down Expand Up @@ -284,9 +285,6 @@ def _swiss_search(self): # pylint: disable=too-many-branches, too-many-statemen
results.append(d)
seen.append(d['id'])

# reduce number of elements in result to limit
results = results[:limit]

# if standard index did not find anything, use soundex/metaphon indices
# which should be more fuzzy in its results
if len(results) <= 0:
Expand Down

0 comments on commit 99f2093

Please sign in to comment.