mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-09 19:44:07 +00:00
reduce importance when computed from search rank
This commit is contained in:
@@ -233,7 +233,7 @@ class BaseResult:
|
||||
of the value or an artificial value computed from the place's
|
||||
search rank.
|
||||
"""
|
||||
return self.importance or (0.7500001 - (self.rank_search/40.0))
|
||||
return self.importance or (0.40001 - (self.rank_search/75.0))
|
||||
|
||||
|
||||
def localize(self, locales: Locales) -> None:
|
||||
|
||||
@@ -700,7 +700,7 @@ class PlaceSearch(AbstractSearch):
|
||||
or (details.viewbox is not None and details.viewbox.area < 0.5):
|
||||
sql = sql.order_by(
|
||||
penalty - sa.case((tsearch.c.importance > 0, tsearch.c.importance),
|
||||
else_=0.75001-(sa.cast(tsearch.c.search_rank, sa.Float())/40)))
|
||||
else_=0.40001-(sa.cast(tsearch.c.search_rank, sa.Float())/75)))
|
||||
sql = sql.add_columns(t.c.importance)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user