Skip to content

Add category schema foundation to place and placex#4106

Open
Itz-Agasta wants to merge 3 commits into
osm-search:masterfrom
Itz-Agasta:category-support
Open

Add category schema foundation to place and placex#4106
Itz-Agasta wants to merge 3 commits into
osm-search:masterfrom
Itz-Agasta:category-support

Conversation

@Itz-Agasta
Copy link
Copy Markdown
Contributor

Summary

This PR adds the db foundation for category support.

  • add categories as an ltree[] column in the import-side place schema
  • make fresh database setup create the ltree extension
  • add a GiST index on placex.categories
  • propagate the new column through the place -> placex paths used during import and updates
  • add migration support for existing databases (it will be updated later again)

As per the plan this pr only deals with the schema foundation part. So we now have empty catagory columns in our tables. Next pr will introduce the Data plumbing logic so the empty columns get populated with proper osm category data (and we can benchmark the migartion/import speed here). 3rd pr will be dealing with cleanup of unsued tables and their artifacts and force existing nominatim services to use the newly introduced category column.

AI usage

The test/python/tools/test_migration.py file's logic (do we really need it ?)

Contributor guidelines (mandatory)

  • I have adhered to the coding style
  • I have tested the proposed changes
  • I have disclosed above any use of AI to generate code, documentation, or the pull request description

Enables hierarchical category filtering by introducing ltree array columns and indexes for place data.
Ensures database setup creates the necessary ltree extension and updates tests and import logic for category handling.
Facilitates efficient category-based queries for POI and proximity searches.
Introduces handling for categories when inserting and updating place
and placex entries, ensuring category data is properly stored and
kept in sync with other attributes.
Introduces a new categories column of type ltree[] to the relevant tables,
enabling future support for hierarchical place categorization. Ensures
idempotency of the migration and includes tests to verify both schema
change and repeated migration behavior.

Prepares schema for upcoming backfill and propagation logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant