X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/109af0ef1c55421a166fd2d45586d04fe7f6f969..0806e5dff439ef5bdb91a378abb0fd61983d6a24:/docs/admin/Maintenance.md?ds=sidebyside diff --git a/docs/admin/Maintenance.md b/docs/admin/Maintenance.md index 782b377c..325e6f8f 100644 --- a/docs/admin/Maintenance.md +++ b/docs/admin/Maintenance.md @@ -34,18 +34,39 @@ to rerun the statistics computation when adding larger amounts of new data, for example, when adding an additional country via `nominatim add-data`. +## Forcing recomputation of places and areas + +Command: `nominatim refresh --data-object [NWR] --data-area [NWR]` + +When running replication updates, Nominatim tries to recompute the search +and address information for all places that are affected by a change. But it +needs to restrict the total number of changes to make sure it can keep up +with the minutely updates. Therefore it will refrain from propagating changes +that affect a lot of objects. + +The administrator may force an update of places in the database. +`nominatim refresh --data-object` invalidates a single OSM object. +`nominatim refresh --data-area` invalidates an OSM object and all dependent +objects. That are usually the places that inside its area or around the +center of the object. Both commands expect the OSM object as an argument +of the form OSM type + OSM id. The type must be `N` (node), `W` (way) or +`R` (relation). + +After invalidating the object, indexing must be run again. If continuous +update are running in the background, the objects will be recomputed together +with the next round of updates. Otherwise you need to run `nominatim index` +to finish the recomputation. + + ## Removing large deleted objects +Command: `nominatim admin --clean-deleted ` + Nominatim refuses to delete very large areas because often these deletions are accidental and are reverted within hours. Instead the deletions are logged in the `import_polygon_delete` table and left to the administrator to clean up. -There is currently no command to do that. You can use the following SQL -query to force a deletion on all objects that have been deleted more than -a certain timespan ago (here: 1 month): +To run this command you will need to pass a PostgreSQL time interval. For example to +delete any objects that have been deleted more than a month ago you would run: +`nominatim admin --clean-deleted '1 month'` -```sql -SELECT place_force_delete(p.place_id) FROM import_polygon_delete d, placex p -WHERE p.osm_type = d.osm_type and p.osm_id = d.osm_id - and age(p.indexed_date) > '1 month'::interval -```