You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to experiment with manually modifying the ranking of places returned by Photon. In our concrete example the search for "Ahrensburg" returns the city of Ahrensburg and then the two subway stations, but not the main train station - at least not ranked high enough. This is because the train station doesn't have a wikidata or wikipedia tag.
Therefore we want to experiment with manually changing the importance.
Connecting to the Nominatim DB
If you're ssh'ed into the host infrastracture.stadtnavi.eu you can use the following command line to connect to the nominatim DB:
psql -h localhost -p 5432 -U nominatim
The password required is in the ansible vault but is visiable in decrypted form in the file /etc/systemd/system/nominatim.service.
IntelliJ
If you have the professional version of IntelliJ you can also use that for inspecting the database. For this you need to set up SSH tunneling in the UI.
Queries
If you want to find your way around a little, you could use the following queries:
-- Ahrensburg West (U-Bahn)
select * from placex where osm_id = 6233764950;
-- Ahrensburg Ost (U-Bahn)
select * from placex where osm_id = 5196118052;
-- Ahrensburg (Deutsche Bahn)
select * from placex where osm_id = 3205295000;
Setting the importance
In the queries and in the Photon debug output you can see that the two subway station have a score of ~0.31. We want to set the importance to something above that.
(Hamburg main station has an importance of ~0.46, by the way.)
The following query will set the wikipedia tag to the one of the city of Ahrensburg. and set the indexing status to 2, meaning Photon will know that it needs to import the row:
update placex set extratags = extratags || hstore('wikipedia', 'en:Ahrensburg'), indexed_status = 2 where osm_id = 3205295000;
During Photon's import it also sets the indexed_status and this will retrigger a computation of the importance.
Updating Photon
Now that we have updated the DB we can then trigger a Photon reimport with:
sudo systemctl start photon-update.service
You this will return immediately as it only triggers the HTTP call to start the import. You can view the progress in the log with
journalctl -u photon -f
If you have only a few rows to import then it should complete within seconds.
Result
Searching for Ahrensburg will lead to the train station being ranked highest.
The text was updated successfully, but these errors were encountered:
We want to experiment with manually modifying the ranking of places returned by Photon. In our concrete example the search for "Ahrensburg" returns the city of Ahrensburg and then the two subway stations, but not the main train station - at least not ranked high enough. This is because the train station doesn't have a
wikidata
orwikipedia
tag.Therefore we want to experiment with manually changing the importance.
Connecting to the Nominatim DB
If you're ssh'ed into the host
infrastracture.stadtnavi.eu
you can use the following command line to connect to the nominatim DB:The password required is in the ansible vault but is visiable in decrypted form in the file
/etc/systemd/system/nominatim.service
.IntelliJ
If you have the professional version of IntelliJ you can also use that for inspecting the database. For this you need to set up SSH tunneling in the UI.
Queries
If you want to find your way around a little, you could use the following queries:
Setting the importance
In the queries and in the Photon debug output you can see that the two subway station have a score of ~0.31. We want to set the importance to something above that.
(Hamburg main station has an importance of ~0.46, by the way.)
The following query will set the
wikipedia
tag to the one of the city of Ahrensburg. and set the indexing status to 2, meaning Photon will know that it needs to import the row:During Photon's import it also sets the
indexed_status
and this will retrigger a computation of the importance.Updating Photon
Now that we have updated the DB we can then trigger a Photon reimport with:
You this will return immediately as it only triggers the HTTP call to start the import. You can view the progress in the log with
If you have only a few rows to import then it should complete within seconds.
Result
Searching for Ahrensburg will lead to the train station being ranked highest.
The text was updated successfully, but these errors were encountered: