]> git.openstreetmap.org Git - nominatim.git/log
nominatim.git
4 days agorelease 5.3.2.post11 master
Sarah Hoffmann [Sat, 5 Sep 2026 15:45:41 +0000 (17:45 +0200)]
release 5.3.2.post11

4 days agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Sat, 5 Sep 2026 15:23:14 +0000 (17:23 +0200)]
Merge remote-tracking branch 'upstream/master'

4 days agoMerge pull request #4185 from lonvia/us-postcode-radius
Sarah Hoffmann [Sat, 5 Sep 2026 15:17:55 +0000 (17:17 +0200)]
Merge pull request #4185 from lonvia/us-postcode-radius

Increase postcode extent for the US

4 days agoMerge pull request #4177 from justpriyanshu/fix-4172-drop-unwanted-categories
Sarah Hoffmann [Sat, 5 Sep 2026 14:11:19 +0000 (16:11 +0200)]
Merge pull request #4177 from justpriyanshu/fix-4172-drop-unwanted-categories

Fix 4172 drop unwanted categories

4 days agoincrease postcode extent for the US
Sarah Hoffmann [Sat, 5 Sep 2026 12:20:17 +0000 (14:20 +0200)]
increase postcode extent for the US

7 days agoadd test for unwanted categories in rank computation
justpriyanshu [Fri, 28 Aug 2026 09:15:47 +0000 (09:15 +0000)]
add test for unwanted categories in rank computation

7 days agoMerge pull request #4171 from pawank925/fix-unnamed-street-pois
Sarah Hoffmann [Wed, 2 Sep 2026 18:42:48 +0000 (20:42 +0200)]
Merge pull request #4171 from pawank925/fix-unnamed-street-pois

Make POIs on unnamed streets searchable by address #4133

8 days agoMerge pull request #4179 from lonvia/improve-parent-search
Sarah Hoffmann [Tue, 1 Sep 2026 18:59:42 +0000 (20:59 +0200)]
Merge pull request #4179 from lonvia/improve-parent-search

Switch nearest road/place search to KNN

8 days agodecrease the radius for nearest mapping of streets
Sarah Hoffmann [Tue, 1 Sep 2026 14:53:50 +0000 (16:53 +0200)]
decrease the radius for nearest mapping of streets

8 days agoslightly increase update radius for changed streets
Sarah Hoffmann [Tue, 25 Aug 2026 18:22:55 +0000 (20:22 +0200)]
slightly increase update radius for changed streets

8 days agouse knn to find nearest street and place
Sarah Hoffmann [Tue, 25 Aug 2026 17:43:47 +0000 (19:43 +0200)]
use knn to find nearest street and place

8 days agouse knn search to parent with nearest road
Sarah Hoffmann [Tue, 25 Aug 2026 15:19:45 +0000 (17:19 +0200)]
use knn search to parent with nearest road

13 days agoignore unwanted categories when computing ranks
justpriyanshu [Fri, 28 Aug 2026 08:58:09 +0000 (08:58 +0000)]
ignore unwanted categories when computing ranks

The checks for unwanted highway and boundary categories were only used
to decide whether a place is rankable at all. The offending categories
remained in the category list, so compute_place_rank() would still pick
up their ranks. Move the checks into drop_unwanted_categories() and
filter the categories before computing ranks.

Refs #4172

2 weeks agoMerge pull request #4166 from Itz-Agasta/docs-category-series
Sarah Hoffmann [Sat, 22 Aug 2026 19:58:19 +0000 (21:58 +0200)]
Merge pull request #4166 from Itz-Agasta/docs-category-series

Update the documentation for the category series

3 weeks agoAdd a migration note about the categories column
Itz-Agasta [Fri, 14 Aug 2026 07:24:37 +0000 (12:54 +0530)]
Add a migration note about the categories column

3 weeks agoUpdate the details documentation for merged place entries
Itz-Agasta [Fri, 14 Aug 2026 07:24:37 +0000 (12:54 +0530)]
Update the details documentation for merged place entries

3 weeks agoDocument the include and exclude search parameters
Itz-Agasta [Fri, 14 Aug 2026 07:24:37 +0000 (12:54 +0530)]
Document the include and exclude search parameters

3 weeks agoDocument categories in the import style documentation
Itz-Agasta [Fri, 14 Aug 2026 07:24:37 +0000 (12:54 +0530)]
Document categories in the import style documentation

An object with several main tags gets one database entry with a category
per tag now, instead of one entry per tag. Describe how a category is
built from a main tag and which of the main tags ends up as the class and
type of the place. Fallback tags always contribute a category now, they
only lose the race for class and type.

3 weeks agoUpdate the database layout documentation
Itz-Agasta [Fri, 14 Aug 2026 07:24:37 +0000 (12:54 +0530)]
Update the database layout documentation

The place table holds a single row per OSM object now, with a categories
column that carries all of its main tags. Document that, the categories
column on placex and the tables that were added since the page was last
touched: place_entrance, placex_entrance, place_associated_street and
location_area_country. The place_classtype tables are gone, so drop them
from the list of auxiliary tables.

Also bring the diagrams back in line with the schema. search_name lost
its search_rank column a while ago and location_postcodes gained is_area,
while its centroid was missing from the diagram because of a typo.

3 weeks agoMerge pull request #4164 from Itz-Agasta/category-support
Sarah Hoffmann [Tue, 18 Aug 2026 13:43:26 +0000 (15:43 +0200)]
Merge pull request #4164 from Itz-Agasta/category-support

Add category filters to the search API

3 weeks agoAdd search terms for POIs on unnamed streets
pawank925 [Sun, 16 Aug 2026 18:01:26 +0000 (23:31 +0530)]
Add search terms for POIs on unnamed streets

When a POI is parented to an unnamed street, the street has no entry in
the search_name table. The POI then gets no address terms at all and
can only be found by its name. Use the address objects of the parent
from place_addressline to fill in the missing address terms.

3 weeks agoAdd BDD tests for repeated include/exclude parameters
Itz-Agasta [Sat, 15 Aug 2026 15:34:45 +0000 (21:04 +0530)]
Add BDD tests for repeated include/exclude parameters

A parameter listed more than once in the step table is now sent as a
repeated request parameter.

3 weeks agoUse the categories column for category matching on SQLite as well
Itz-Agasta [Sat, 15 Aug 2026 15:34:30 +0000 (21:04 +0530)]
Use the categories column for category matching on SQLite as well

CategoryMatch fell back to the class/type columns on SQLite only
because the categories column was unreadable there. With the result
processor fixed, the substring emulation works for all cases, so the
two functions collapse into one. It also matches merged rows, where
the class/type pair only carries the first of several categories.

The placex(class_, type) index stays, it is still used by the
qualifier restriction of the name searches.

3 weeks agoOnly accept underscores in category filters
Itz-Agasta [Sat, 15 Aug 2026 15:34:22 +0000 (21:04 +0530)]
Only accept underscores in category filters

The conversion from hyphens to underscores in the Lua code exists for
compatibility with OSM tags we have no influence over. The API can be
strict instead.

3 weeks agoMake get_all() an abstract method of ASGIAdaptor
Itz-Agasta [Sat, 15 Aug 2026 15:34:10 +0000 (21:04 +0530)]
Make get_all() an abstract method of ASGIAdaptor

A default implementation that silently returns only the first value
hides a missing override in a new adaptor implementation.

4 weeks agoAdd include/exclude parameters to the search endpoint
Itz-Agasta [Wed, 12 Aug 2026 08:10:06 +0000 (13:40 +0530)]
Add include/exclude parameters to the search endpoint

4 weeks agoFilter search results by category
Itz-Agasta [Wed, 12 Aug 2026 08:10:06 +0000 (13:40 +0530)]
Filter search results by category

Applies to every search returning placex rows. Sources without
categories return nothing when an include filter is given.

4 weeks agoAdd include/exclude category filters to SearchDetails
Itz-Agasta [Wed, 12 Aug 2026 08:10:06 +0000 (13:40 +0530)]
Add include/exclude category filters to SearchDetails

4 weeks agoLet adaptors read repeated request parameters
Itz-Agasta [Wed, 12 Aug 2026 08:10:06 +0000 (13:40 +0530)]
Let adaptors read repeated request parameters

Not an abstract method, so that external adaptors keep working. They
then see only the first value of a repeated parameter.

4 weeks agoParse the array literal returned for the categories column
Itz-Agasta [Wed, 12 Aug 2026 08:10:06 +0000 (13:40 +0530)]
Parse the array literal returned for the categories column

The driver does not know ltree[] and hands out the array literal as a
string. The SQLite export then joined the characters of that string
instead of the categories.

4 weeks agorelease 5.3.2.post9
Sarah Hoffmann [Sun, 9 Aug 2026 09:07:36 +0000 (11:07 +0200)]
release 5.3.2.post9

4 weeks agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Sun, 9 Aug 2026 08:19:16 +0000 (10:19 +0200)]
Merge remote-tracking branch 'upstream/master'

4 weeks agoMerge pull request #4163 from Itz-Agasta/category-support
Sarah Hoffmann [Sun, 9 Aug 2026 08:12:41 +0000 (10:12 +0200)]
Merge pull request #4163 from Itz-Agasta/category-support

Remove the place_classtype tables

4 weeks agoDo not drop the place_classtype tables on migration
Itz-Agasta [Sun, 9 Aug 2026 06:56:31 +0000 (12:26 +0530)]
Do not drop the place_classtype tables on migration

Migration and frontend restart do not happen at the same time. The documented order is to migrate first and restart the API afterwards, so there is a window where the old frontend code is still running against a migrated database. That code caches which place_classtype_* tables exist and would query tables that are already gone.

Leave the tables in place instead and document in the migration guide how to drop them manually once all frontends run the new version.

4 weeks agorelease 5.3.2.post8
Sarah Hoffmann [Sat, 8 Aug 2026 13:48:08 +0000 (15:48 +0200)]
release 5.3.2.post8

4 weeks agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Sat, 8 Aug 2026 12:16:02 +0000 (14:16 +0200)]
Merge remote-tracking branch 'upstream/master'

4 weeks agoDeprecate --min option instead of removing it
Itz-Agasta [Sat, 8 Aug 2026 07:10:07 +0000 (12:40 +0530)]
Deprecate --min option instead of removing it

5 weeks agoDrop the place_classtype tables on migration
Itz-Agasta [Thu, 6 Aug 2026 09:02:07 +0000 (14:32 +0530)]
Drop the place_classtype tables on migration

Nothing creates or reads them anymore, so a migrated database would keep
carrying them around for nothing. On a planet that is 428 tables and a
good 8GB.

The migration runs after the POI backfill, which still needs the table
names to work out which rows to fill in.

5 weeks agoStop copying the place_classtype tables into SQLite
Itz-Agasta [Thu, 6 Aug 2026 09:01:52 +0000 (14:31 +0530)]
Stop copying the place_classtype tables into SQLite

The conversion mirrored every table into the SQLite file and built a
spatial index on each of them. It also wrote a minimal stand-in for
pg_tables, which was only there so that get_class_table() could look the
tables up on SQLite. None of it is needed now that category search
matches on class/type.

5 weeks agoRemove Connection.get_class_table()
Itz-Agasta [Thu, 6 Aug 2026 09:01:17 +0000 (14:31 +0530)]
Remove Connection.get_class_table()

The POI and near searches went through this to find the table for a
category. Both query the categories column directly since the switch, so
the helper has had no callers left.

5 weeks agoStop creating the place_classtype tables from special phrases
Itz-Agasta [Thu, 6 Aug 2026 09:01:06 +0000 (14:31 +0530)]
Stop creating the place_classtype tables from special phrases

The special phrase import created one table per class/type pair, indexed
it on centroid and place_id and granted the webuser access to it. Nothing
reads those tables anymore, so all of that goes. What is left is
collecting the phrases and handing them to the tokenizer.

The --min option only decided which of the tables were created, it never
filtered the phrases themselves, so it has no meaning without them. It is
removed together with get_classtype_pairs().

The table counters in the statistics handler would report zero forever.

5 weeks agoStop maintaining the place_classtype tables on updates
Itz-Agasta [Thu, 6 Aug 2026 09:00:55 +0000 (14:30 +0530)]
Stop maintaining the place_classtype tables on updates

Category search reads the categories column now, so the rows the insert
and delete triggers keep in sync are not read by anything anymore. Both
did a pg_tables lookup on every placex insert and delete to find out
whether a table for the class/type exists, which is pure overhead on
diff updates.

The webuser does not need read access to the tables either.

5 weeks agoMerge pull request #4162 from lonvia/restrict-queries
Sarah Hoffmann [Thu, 6 Aug 2026 09:00:20 +0000 (11:00 +0200)]
Merge pull request #4162 from lonvia/restrict-queries

Add restrictions to length of search queries

5 weeks agodebug output: escape HTML values
marc tobias [Wed, 5 Aug 2026 13:29:48 +0000 (15:29 +0200)]
debug output: escape HTML values

5 weeks agoadd default query preprocessor to restrict queries to 500 chars
Sarah Hoffmann [Wed, 5 Aug 2026 14:01:11 +0000 (16:01 +0200)]
add default query preprocessor to restrict queries to 500 chars

5 weeks agoalso restrict length of full words to 255
Sarah Hoffmann [Wed, 5 Aug 2026 13:40:41 +0000 (15:40 +0200)]
also restrict length of full words to 255

5 weeks agorestrict number of alloable tokens per query to 50
Sarah Hoffmann [Wed, 5 Aug 2026 13:37:43 +0000 (15:37 +0200)]
restrict number of alloable tokens per query to 50

5 weeks agodrop words longer than 255 characters
Sarah Hoffmann [Wed, 5 Aug 2026 13:27:39 +0000 (15:27 +0200)]
drop words longer than 255 characters

It is not possible in OSM to have names that are longer than that.

5 weeks agoMerge pull request #4161 from mtmail/disable-debug-output-by-default
Sarah Hoffmann [Thu, 6 Aug 2026 07:09:37 +0000 (09:09 +0200)]
Merge pull request #4161 from mtmail/disable-debug-output-by-default

disable debug=1 output by default

5 weeks agoMerge pull request #4146 from Itz-Agasta/category-support
Sarah Hoffmann [Thu, 6 Aug 2026 07:05:10 +0000 (09:05 +0200)]
Merge pull request #4146 from Itz-Agasta/category-support

Use ltree categories column instead of place_classtype tables

5 weeks agoSimplify the POI backfill by filtering the classtype tables
Itz-Agasta [Wed, 5 Aug 2026 14:59:32 +0000 (20:29 +0530)]
Simplify the POI backfill by filtering the classtype tables

Only consider place_classtype_* tables whose name consists of valid
ltree label characters. The class and type of the rows to update then
are valid labels by construction and do not need to be sanitized.

5 weeks agodisable debug=1 output by default
marc tobias [Tue, 4 Aug 2026 21:42:25 +0000 (23:42 +0200)]
disable debug=1 output by default

5 weeks agoRestrict the POI category backfill to searchable categories
Itz-Agasta [Sat, 1 Aug 2026 06:43:48 +0000 (12:13 +0530)]
Restrict the POI category backfill to searchable categories

Only class/type combinations that have a place_classtype_* table can be
reached through a special phrase, and those are exactly the ones master
resolved through Connection.get_class_table(). Look the tables up the
same way and restrict the UPDATE to rows that match one. That takes the
planet from 303,652,952 to 46,222,253 rows and skips the step entirely
on databases that never imported special phrases.

The value expression now matches backfill_categories, so a POI also
picks up the osm.place.* category from its extratags.

Categories without a table are no longer found by the [key=value]
syntax on a migrated database. Those need a reimport.

Also unskip the [club=scout] search test. It asserted on the reported
class/type, which is the row's own main tag rather than the queried
category. Check for the two deterministic objects instead; the third
result is subject to deduplication.

5 weeks agoMerge pull request #4157 from lonvia/tweak-country-languages
Sarah Hoffmann [Thu, 30 Jul 2026 17:25:12 +0000 (19:25 +0200)]
Merge pull request #4157 from lonvia/tweak-country-languages

Remove srp from languages for Montenegro

5 weeks agoMerge pull request #4155 from mtmail/validate-layer-parameter
Sarah Hoffmann [Thu, 30 Jul 2026 14:05:56 +0000 (16:05 +0200)]
Merge pull request #4155 from mtmail/validate-layer-parameter

validate layer URL parameter values

5 weeks agoremove srp from languages for Montenegro
Sarah Hoffmann [Thu, 30 Jul 2026 13:46:57 +0000 (15:46 +0200)]
remove srp from languages for Montenegro

It's just the 3-letter code for the already existing sr.

6 weeks agoMerge pull request #4149 from AyushDharDubey/issue_4125
Sarah Hoffmann [Thu, 30 Jul 2026 09:22:35 +0000 (11:22 +0200)]
Merge pull request #4149 from AyushDharDubey/issue_4125

Add `clean_multilingual_names` Sanitizer

6 weeks agoBackfill the categories column for POIs
Itz-Agasta [Thu, 30 Jul 2026 09:10:33 +0000 (14:40 +0530)]
Backfill the categories column for POIs

The backfill in the previous migration only filled the rank_address < 26
rows that place linking needs. Category search reads the column for POIs
as well, so a migrated database would find almost nothing for them.

Only the class/type category can be derived from placex, which is the
same one the lazy backfill in placex_update adds. Categories from
secondary tags still need a reimport.

6 weeks agoDrop the obsolete categories index on migration
Itz-Agasta [Thu, 30 Jul 2026 08:57:29 +0000 (14:27 +0530)]
Drop the obsolete categories index on migration

The earlier migration does not create idx_placex_categories anymore, so
this only cleans up after databases that ran it before that change. Drop
it before creating the combined index, so that the two are never on disk
at the same time.

6 weeks agoAlways create the combined centroid/categories index
Itz-Agasta [Thu, 30 Jul 2026 07:19:14 +0000 (12:49 +0530)]
Always create the combined centroid/categories index

Reverse queries will need the index as well, so it is not restricted to
databases with a search_name table.

6 weeks agoUse a single query for the POI category search
Itz-Agasta [Thu, 30 Jul 2026 07:19:14 +0000 (12:49 +0530)]
Use a single query for the POI category search

The near/small-radius branch searched placex directly while the other
branch went through the place_classtype tables. Now that both go through
the categories column, the only remaining differences were the importance
column and the linked_place_id filter, so fold them into one query.

The remaining geometry conditions in the near branch move to the centroid
as well, so that the combined centroid/categories index can serve the
spatial and the category condition at once. Linked places are now excluded
in all cases, as they are duplicates of the place they are linked to.

6 weeks agoMatch categories on the centroid instead of the geometry
Itz-Agasta [Mon, 27 Jul 2026 11:16:58 +0000 (16:46 +0530)]
Match categories on the centroid instead of the geometry

Category search used to run against the place_classtype tables, which
hold a centroid and index it. Moving to the categories column also
moved the searches onto placex.geometry, which changed what the filter
means and traded a small centroid index for the 22GB geometry index
over the whole of placex.

Put both searches back on the centroid, where the combined
centroid/categories index can serve them. This also reverts the
geometry prefilter in the near search: it was there to prune the
non-spatial categories index, and the combined index prunes on its
own.

Note that the near_radius branch of the POI search is left alone. It
queried placex.geometry before this change as well.

6 weeks agoIndex placex centroid for the SQLite category search
Itz-Agasta [Mon, 27 Jul 2026 11:16:58 +0000 (16:46 +0530)]
Index placex centroid for the SQLite category search

SQLite has no ltree, so category search matches on class/type, but it
still needs the spatial part of the query to be indexed. Only
placex.geometry had a spatial index, so moving the category searches
onto the centroid would leave them without one and the SpatialIndex
subquery would match nothing.

6 weeks agoUse a combined centroid/categories index for category search
Itz-Agasta [Mon, 27 Jul 2026 11:16:20 +0000 (16:46 +0530)]
Use a combined centroid/categories index for category search

The plain ltree index on categories is not spatial, so a category
search bounded by a viewbox or a search area had to combine it with
a second index and AND two large bitmaps together. On a full planet
that made the near search take 510ms and the bounded POI search
106ms, against 22ms and 0.7ms for the place_classtype tables they
replace.

Put the centroid in front of the categories in a combined GiST index
instead. Measured on a full planet import, that brings the POI search
to 1.2ms and the near search to 74ms.

Two details on the definition. The centroid comes first because a
GiST index is ineffective when its first column has few distinct
values, which is exactly what the lossy signatures of the categories
column are; it also builds faster and smaller (12:22 and 5125MB
against 19:45 and 5376MB for the other order). The index is not
partial because the predicate would otherwise make it unusable for
queries on the centroid alone, which cost only 10 to 20% on the
category queries but takes a plain centroid lookup from a sequential
scan to an index scan.

siglen=8 keeps the size manageable. The default for gist__ltree_ops
is 28 bytes, which on a planet with full category coverage would put
the index well above the 22GB it takes now.

The index gets a new name, so the now unused idx_placex_categories
is simply dropped from the earlier migration rather than replaced.
Since that migration is already released, the new index needs a
migration step of its own.

6 weeks agoApply spatial pruning in near search
Itz-Agasta [Tue, 21 Jul 2026 17:16:38 +0000 (22:46 +0530)]
Apply spatial pruning in near search

Introduce search_area to prune with the geometry GiST index and
keep the centroid containment as a recheck. When rank_address > 9
and the geometry is an area, use the geometry; otherwise expand
the centroid by 0.05. Update the join to intersect with search_area
and use ST_CoveredBy(search_area) for containment.

6 weeks agoIndex placex(class,type) for the SQLite category search
Itz-Agasta [Thu, 9 Jul 2026 06:19:32 +0000 (11:49 +0530)]
Index placex(class,type) for the SQLite category search

SQLite has no ltree, so category search matches on class/type there and
needs a matching composite index.

6 weeks agoKeep the object class/type in the result category field
Itz-Agasta [Thu, 9 Jul 2026 06:19:04 +0000 (11:49 +0530)]
Keep the object class/type in the result category field

Revert the per-category match tracking; report the row's own class/type
as before and collapse the POI query into a single indexed lookup.
Re-skip the club=scout scenario: a merged placex row cannot surface a
non-winning searched category under this model.(we will fix it soon)

6 weeks agoRework category matching: move to sql functions, reject invalid
Itz-Agasta [Thu, 9 Jul 2026 06:17:21 +0000 (11:47 +0530)]
Rework category matching: move to sql functions, reject invalid
categories

Relocate CategoryMatch to sqlalchemy_functions.py alongside the other
compiled functions. Reject class/type special tokens that cannot form a
valid ltree at token collection, so search never emits an unindexed
class/type fallback; category_filter now always hits the ltree index.
Update the S-token test mocks to carry a class.

6 weeks agoUpdate search tests for the categories column
Itz-Agasta [Mon, 6 Jul 2026 12:21:30 +0000 (17:51 +0530)]
Update search tests for the categories column

Populate categories in the placex test fixture, drop the obsolete place_classtype table helper and its scenarios, and unskip the key/value category search BDD test.

6 weeks agoQuery the categories column for POI and near search
Itz-Agasta [Mon, 6 Jul 2026 12:20:40 +0000 (17:50 +0530)]
Query the categories column for POI and near search

Replace the place_classtype_* table lookups in PoiSearch and NearSearch with queries against the ltree categories column  (categories <@ 'osm.<class>.<type>'), backed by the GiST index. SQLite, which has no ltree, falls back to class/type equality. Because a merged placex row now carries several categories, both searches report the searched category rather than the row's class/type. get_class_table() is kept with a TODO; the place_classtype_* tables are removed in a follow-up PR.

6 weeks agoAdd ltree categories column to the API placex schema
Itz-Agasta [Mon, 6 Jul 2026 12:00:29 +0000 (17:30 +0530)]
Add ltree categories column to the API placex schema

Introduce a CategoryArray SQLAlchemy type that maps to the native ltree[] column on PostgreSQL and to comma-separated text on SQLite. Register the categories column on the placex table so the search side can query it.

6 weeks agovalidate layer URL parameter values
marc tobias [Wed, 29 Jul 2026 22:16:55 +0000 (00:16 +0200)]
validate layer URL parameter values

6 weeks agoadd clean_multilingual_names sanitizer
Ayush Dhar Dubey [Wed, 15 Jul 2026 16:52:09 +0000 (22:22 +0530)]
add clean_multilingual_names sanitizer

6 weeks agoMerge pull request #4153 from Itz-Agasta/require-postgresql-13
Sarah Hoffmann [Tue, 28 Jul 2026 12:37:38 +0000 (14:37 +0200)]
Merge pull request #4153 from Itz-Agasta/require-postgresql-13

Require PostgreSQL 13 as minimum version

6 weeks agoRequire PostgreSQL 13 as minimum version
Itz-Agasta [Tue, 28 Jul 2026 11:47:16 +0000 (17:17 +0530)]
Require PostgreSQL 13 as minimum version

PostgreSQL 12 is out of support upstream and lacks operator class
parameters, which are needed to keep the ltree GiST indexes at a
reasonable size. Raise the minimum version to 13 and run the ubuntu-22
CI job against PostgreSQL 13.

6 weeks agoMerge pull request #4152 from Itz-Agasta/fix/4148-empty-poi-results
Sarah Hoffmann [Mon, 27 Jul 2026 12:49:45 +0000 (14:49 +0200)]
Merge pull request #4152 from Itz-Agasta/fix/4148-empty-poi-results

Fix 500 error on category search without matching results

6 weeks agoReturn empty result list for category searches without matches
Itz-Agasta [Sat, 25 Jul 2026 18:21:29 +0000 (23:51 +0530)]
Return empty result list for category searches without matches

A /search request using the [key=value] category syntax together with a
near-phrase crashed with a 500 error whenever the search legitimately
found nothing.

Two places in ForwardGeocoder.lookup_pois() indexed into an empty list:

* sort_and_cut_results() accessed results[0] without checking that any
  results were found. The guard was lost in 87a8c246.
* execute_searches() accessed searches[0] when the near-phrase produced
  no search interpretations at all. lookup_pois() guarded this with
  'if query', which is always true because QueryStruct has no __bool__.
  Use 'if searches' instead, as lookup() already does.

Fixes #4148

2 months agoMerge pull request #4144 from RhinoDevel/patch-1
Sarah Hoffmann [Wed, 8 Jul 2026 07:13:10 +0000 (09:13 +0200)]
Merge pull request #4144 from RhinoDevel/patch-1

update_database.sh: Always execute nominatim index

2 months agoupdate_database.sh: Add empty photon_update string, if unused.
RhinoDevel [Fri, 3 Jul 2026 12:46:41 +0000 (14:46 +0200)]
update_database.sh: Add empty photon_update string, if unused.

2 months agoFix variable name.
RhinoDevel [Fri, 3 Jul 2026 12:40:33 +0000 (14:40 +0200)]
Fix variable name.

2 months agoupdate_database.sh: Always execute nominatim index
RhinoDevel [Fri, 3 Jul 2026 12:35:16 +0000 (14:35 +0200)]
update_database.sh: Always execute nominatim index

The script was misleading by implying that the Photon update also does the indexing of the Nominatim database.

See: https://github.com/osm-search/Nominatim/discussions/4143

2 months agoMerge pull request #4142 from lonvia/improve-attribute-meaning-in-query-node
Sarah Hoffmann [Fri, 3 Jul 2026 09:25:16 +0000 (11:25 +0200)]
Merge pull request #4142 from lonvia/improve-attribute-meaning-in-query-node

Align meaning of attributes in query node

2 months agoharmonize attributes in query node
Sarah Hoffmann [Thu, 2 Jul 2026 08:55:27 +0000 (10:55 +0200)]
harmonize attributes in query node

All attributes referring to edges now refer to the outgoing edge.

2 months agoMerge pull request #4106 from Itz-Agasta/category-support
Sarah Hoffmann [Thu, 2 Jul 2026 07:41:46 +0000 (09:41 +0200)]
Merge pull request #4106 from Itz-Agasta/category-support

Add ltree categories column for multi-tag OSM object support

2 months agoUpdate BDD and Python tests for categories
Itz-Agasta [Wed, 1 Jul 2026 16:02:46 +0000 (21:32 +0530)]
Update BDD and Python tests for categories

Adapt test fixtures and assertions for the new categories column and single-row merge model. Verify that categories are generated, propagated, and queried correctly using ltree operators.

2 months agoAdd migration for categories on existing databases
Itz-Agasta [Wed, 1 Jul 2026 16:01:43 +0000 (21:31 +0530)]
Add migration for categories on existing databases

Add a schema migration that introduces the categories ltree[]
column to place and placex, backfills it from existing class/type data and extratags->place values for rank_address < 26 with triggers disabled, creates the required indexes, and runs ANALYZE after the bulk update.

2 months agoUpdate indexer boundary queries for categories
Itz-Agasta [Wed, 1 Jul 2026 16:00:27 +0000 (21:30 +0530)]
Update indexer boundary queries for categories

Change BoundaryRunner and Indexer SQL to use
categories <@ 'osm.boundary.administrative'
instead of class='boundary' AND type='administrative'.

2 months agoUpdate SQL ranking and triggers to use ltree categories
Itz-Agasta [Wed, 1 Jul 2026 16:00:03 +0000 (21:30 +0530)]
Update SQL ranking and triggers to use ltree categories

Adapt is_rankable_place(), compute_place_rank(), and the
placex_update trigger to query the categories column using ltree
containment operators (<@) instead of class/type comparisons.

compute_place_rank() now iterates all categories and selects the
best rank. Boundary linking extracts the place type from
categories instead of extratags.

2 months agoAdd ltree category generation and single-row merge model in Lua
Itz-Agasta [Wed, 1 Jul 2026 15:59:17 +0000 (21:29 +0530)]
Add ltree category generation and single-row merge model in Lua

Introduce sanitize_label() and get_category() to derive ltree
categories from OSM class/type tags. Merge multi-tag OSM objects
into a single place row with all categories in the new ltree[]
column, replacing the previous one-row-per-tag write_place() /
write_row() model.

Also add build_extratags() and simplify the grab_name_parts()
fallback logic.

2 months agoAdd ltree categories column to place/placex schema
Itz-Agasta [Wed, 1 Jul 2026 15:57:41 +0000 (21:27 +0530)]
Add ltree categories column to place/placex schema

Add categories ltree[] column to place and placex tables with a conditional GIST index. Requires the ltree extension. Stores derived OSM categories as ltree paths for efficient containment queries on multi-tag objects.

2 months agoMerge pull request #4139 from lonvia/country-info-for-indexer
Sarah Hoffmann [Sun, 28 Jun 2026 13:41:32 +0000 (15:41 +0200)]
Merge pull request #4139 from lonvia/country-info-for-indexer

Make sure countries are always initialised before calling indexer

2 months agomake sure countries are always initialised before calling indexer
Sarah Hoffmann [Sun, 28 Jun 2026 07:27:13 +0000 (09:27 +0200)]
make sure countries are always initialised before calling indexer

2 months agoMerge pull request #4135 from mtmail/update-multiple-regions-documentation
Sarah Hoffmann [Fri, 26 Jun 2026 12:08:28 +0000 (14:08 +0200)]
Merge pull request #4135 from mtmail/update-multiple-regions-documentation

utils - documentation still mentioned PHP scripts

2 months agoutils - documention still mentioned PHP scripts
marc tobias [Thu, 25 Jun 2026 20:20:05 +0000 (22:20 +0200)]
utils - documention still mentioned PHP scripts

2 months agoMerge pull request #4132 from AyushDharDubey/fix/issue_3598
Sarah Hoffmann [Tue, 23 Jun 2026 20:30:58 +0000 (22:30 +0200)]
Merge pull request #4132 from AyushDharDubey/fix/issue_3598

Fix Windows `ProactorEventLoop` incompatibility with psycopg async

2 months agoupdate python windows requirement
Ayush Dhar Dubey [Tue, 23 Jun 2026 13:27:16 +0000 (18:57 +0530)]
update python windows requirement

2 months agoadd install CI for windows
Ayush Dhar Dubey [Mon, 22 Jun 2026 14:23:56 +0000 (19:53 +0530)]
add install CI for windows

2 months agoadd SelectorEventLoop for windows
Ayush Dhar Dubey [Mon, 22 Jun 2026 12:04:33 +0000 (17:34 +0530)]
add SelectorEventLoop for windows

2 months agofix regex: allow backward slash
Ayush Dhar Dubey [Sun, 21 Jun 2026 21:29:19 +0000 (02:59 +0530)]
fix regex: allow backward slash

2 months agoMerge pull request #4130 from lonvia/avoid-creating-word-lookup-indexes
Sarah Hoffmann [Sat, 20 Jun 2026 12:23:39 +0000 (14:23 +0200)]
Merge pull request #4130 from lonvia/avoid-creating-word-lookup-indexes

Move initial word statistics update into tokenizer finalization