mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-22 21:28:10 +03:00
add penalty for single words that look like stop words
This commit is contained in:
parent
07b7fd1dbb
commit
ff3230a7f3
@ -226,6 +226,8 @@ class SearchBuilder:
|
||||
name_fulls = self.query.get_tokens(name, TokenType.WORD)
|
||||
if name_fulls:
|
||||
fulls_count = sum(t.count for t in name_fulls)
|
||||
if len(name_partials) == 1:
|
||||
penalty += min(1, max(0, (exp_count - 50 * fulls_count) / (1000 * fulls_count)))
|
||||
# At this point drop unindexed partials from the address.
|
||||
# This might yield wrong results, nothing we can do about that.
|
||||
if not partials_indexed:
|
||||
|
Loading…
Reference in New Issue
Block a user