]> git.openstreetmap.org Git - nominatim.git/commit
Match categories on the centroid instead of the geometry
authorItz-Agasta <rupamgolui69@gmail.com>
Mon, 27 Jul 2026 11:16:58 +0000 (16:46 +0530)
committerItz-Agasta <rupamgolui69@gmail.com>
Thu, 30 Jul 2026 07:19:27 +0000 (12:49 +0530)
commit5975512bbfb51d5171eae9ff2921944a1266597c
tree1fe4fafdb13bb6a8642db998ec9ec271260a0ee1
parentd077b66ef1f592886eeab0874e000b28147d8bcc
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.
src/nominatim_api/search/db_searches/near_search.py
src/nominatim_api/search/db_searches/poi_search.py