mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-13 14:24:08 +00:00
Compare commits
6 Commits
986d303c95
...
fed64cda5a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fed64cda5a | ||
|
|
b995803c66 | ||
|
|
310d6e3c92 | ||
|
|
e62811cf97 | ||
|
|
fa2a789e27 | ||
|
|
6fee784c9f |
@@ -29,6 +29,7 @@ DECLARE
|
|||||||
location RECORD;
|
location RECORD;
|
||||||
result prepare_update_info;
|
result prepare_update_info;
|
||||||
extra_names HSTORE;
|
extra_names HSTORE;
|
||||||
|
default_language VARCHAR(10);
|
||||||
BEGIN
|
BEGIN
|
||||||
IF not p.address ? '_inherited' THEN
|
IF not p.address ? '_inherited' THEN
|
||||||
result.address := p.address;
|
result.address := p.address;
|
||||||
@@ -85,6 +86,13 @@ BEGIN
|
|||||||
|
|
||||||
IF location.name is not NULL THEN
|
IF location.name is not NULL THEN
|
||||||
{% if debug %}RAISE WARNING 'Names original: %, location: %', result.name, location.name;{% endif %}
|
{% if debug %}RAISE WARNING 'Names original: %, location: %', result.name, location.name;{% endif %}
|
||||||
|
|
||||||
|
-- Add the linked-place (e.g. city) name as a searchable placename in the default language (if any)
|
||||||
|
default_language := get_country_language_code(location.country_code);
|
||||||
|
IF default_language is not NULL AND NOT location.name ? ('name:' || default_language) THEN
|
||||||
|
location.name := location.name || hstore('name:' || default_language, location.name->'name');
|
||||||
|
END IF;
|
||||||
|
|
||||||
-- Add all names from the place nodes that deviate from the name
|
-- Add all names from the place nodes that deviate from the name
|
||||||
-- in the relation with the prefix '_place_'. Deviation means that
|
-- in the relation with the prefix '_place_'. Deviation means that
|
||||||
-- either the value is different or a given key is missing completely
|
-- either the value is different or a given key is missing completely
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class Indexer:
|
|||||||
cur.execute('ANALYZE')
|
cur.execute('ANALYZE')
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if await self.index_by_rank(0, 4) > 0:
|
if await self.index_by_rank(1, 4) > 0:
|
||||||
_analyze()
|
_analyze()
|
||||||
|
|
||||||
if await self.index_boundaries() > 100:
|
if await self.index_boundaries() > 100:
|
||||||
@@ -68,6 +68,9 @@ class Indexer:
|
|||||||
if await self.index_by_rank(26, 30) > 1000:
|
if await self.index_by_rank(26, 30) > 1000:
|
||||||
_analyze()
|
_analyze()
|
||||||
|
|
||||||
|
# Special case: rank zero depends on the previously-indexed [1..30] ranks
|
||||||
|
await self.index_by_rank(0, 0)
|
||||||
|
|
||||||
if await self.index_postcodes() > 100:
|
if await self.index_postcodes() > 100:
|
||||||
_analyze()
|
_analyze()
|
||||||
|
|
||||||
@@ -147,8 +150,11 @@ class Indexer:
|
|||||||
total += await self._index(runners.RankRunner(rank, analyzer),
|
total += await self._index(runners.RankRunner(rank, analyzer),
|
||||||
batch=batch, total_tuples=total_tuples.get(rank, 0))
|
batch=batch, total_tuples=total_tuples.get(rank, 0))
|
||||||
|
|
||||||
if maxrank == 30:
|
# Special case: rank zero depends on ranks [1..30]
|
||||||
|
if minrank == 0:
|
||||||
total += await self._index(runners.RankRunner(0, analyzer))
|
total += await self._index(runners.RankRunner(0, analyzer))
|
||||||
|
|
||||||
|
if maxrank == 30:
|
||||||
total += await self._index(runners.InterpolationRunner(analyzer), batch=20)
|
total += await self._index(runners.InterpolationRunner(analyzer), batch=20)
|
||||||
|
|
||||||
return total
|
return total
|
||||||
|
|||||||
@@ -297,9 +297,8 @@ Feature: Linking of places
|
|||||||
| R1 | LabelPlace |
|
| R1 | LabelPlace |
|
||||||
|
|
||||||
|
|
||||||
@skip
|
|
||||||
Scenario: Linked places expand default language names
|
Scenario: Linked places expand default language names
|
||||||
Given the grid
|
Given the grid with origin CO
|
||||||
| 1 | | 2 |
|
| 1 | | 2 |
|
||||||
| | 9 | |
|
| | 9 | |
|
||||||
| 4 | | 3 |
|
| 4 | | 3 |
|
||||||
|
|||||||
@@ -226,12 +226,12 @@ async def test_index_partial_with_30(test_db, threads, test_tokenizer):
|
|||||||
idx = indexer.Indexer('dbname=test_nominatim_python_unittest', test_tokenizer, threads)
|
idx = indexer.Indexer('dbname=test_nominatim_python_unittest', test_tokenizer, threads)
|
||||||
await idx.index_by_rank(28, 30)
|
await idx.index_by_rank(28, 30)
|
||||||
|
|
||||||
assert test_db.placex_unindexed() == 27
|
assert test_db.placex_unindexed() == 28
|
||||||
assert test_db.osmline_unindexed() == 0
|
assert test_db.osmline_unindexed() == 0
|
||||||
|
|
||||||
assert test_db.scalar("""
|
assert test_db.scalar("""
|
||||||
SELECT count(*) FROM placex
|
SELECT count(*) FROM placex
|
||||||
WHERE indexed_status = 0 AND rank_address between 1 and 27""") == 0
|
WHERE indexed_status = 0 AND rank_address between 0 and 27""") == 0
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("threads", [1, 15])
|
@pytest.mark.parametrize("threads", [1, 15])
|
||||||
|
|||||||
Reference in New Issue
Block a user