diff --git a/app/search.py b/app/search.py index 27d37a4..ad99f84 100644 --- a/app/search.py +++ b/app/search.py @@ -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) @@ -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: