+def test_very_large_housenumber(apiobj, frontend):
+ apiobj.add_placex(place_id=93, class_='place', type='house',
+ parent_place_id=2000,
+ housenumber='2467463524544', country_code='pt')
+ apiobj.add_placex(place_id=2000, class_='highway', type='residential',
+ rank_search=26, rank_address=26,
+ country_code='pt')
+ apiobj.add_search_name(2000, names=[1,2],
+ search_rank=26, address_rank=26,
+ country_code='pt')
+
+ lookup = FieldLookup('name_vector', [1, 2], LookupAll)
+
+ results = run_search(apiobj, frontend, 0.1, [lookup], [], hnrs=['2467463524544'],
+ details=SearchDetails())
+
+ assert results
+ assert [r.place_id for r in results] == [93, 2000]
+
+
+@pytest.mark.parametrize('wcount,rids', [(2, [990, 991]), (30000, [990])])
+def test_name_and_postcode(apiobj, frontend, wcount, rids):
+ apiobj.add_placex(place_id=990, class_='highway', type='service',
+ rank_search=27, rank_address=27,
+ postcode='11225',
+ centroid=(10.0, 10.0),
+ geometry='LINESTRING(9.995 10, 10.005 10)')
+ apiobj.add_search_name(990, names=[111], centroid=(10.0, 10.0),
+ search_rank=27, address_rank=27)
+ apiobj.add_placex(place_id=991, class_='highway', type='service',
+ rank_search=27, rank_address=27,
+ postcode='11221',
+ centroid=(10.1, 10.1),
+ geometry='LINESTRING(9.995 10.1, 10.005 10.1)')
+ apiobj.add_search_name(991, names=[111], centroid=(10.1, 10.1),
+ search_rank=27, address_rank=27)
+ apiobj.add_postcode(place_id=100, country_code='ch', postcode='11225',
+ geometry='POINT(10 10)')
+
+ lookup = FieldLookup('name_vector', [111], LookupAll)
+
+ results = run_search(apiobj, frontend, 0.1, [lookup], [], pcs=['11225'], count=wcount,
+ details=SearchDetails())
+
+ assert results
+ assert [r.place_id for r in results] == rids
+
+