Skip to content

popularity scoring for "important" venues#394

Merged
missinglink merged 1 commit into
masterfrom
popularity
Mar 9, 2021
Merged

popularity scoring for "important" venues#394
missinglink merged 1 commit into
masterfrom
popularity

Conversation

@missinglink

@missinglink missinglink commented Mar 5, 2021

Copy link
Copy Markdown
Member

Today I was investigating the scoring of the autocomplete query Angkor Wat.

The top three results are:

0) Restaurant Angkor Wat, Berlin, Germany
1) Angkor Wat Ticket Office, SI, Cambodia
2) Angkor Wat, SI, Cambodia

The top two results are from OSM and score higher due to a popularity score, despite the last result having a lower field length.

This PR adds the ability to control popularity scores in geonames that mirrors the functionality we introduced for OSM venue scoring.

For now I've only added two feature codes, but open to adding more later.
I've also edited that one specific Angkor Wat geonames record to give it a more appropriate feature code (previously RUIN).

Regarding future extension/detection, I've added the feature code to the addendum so we can establish trends in the data which may require future changes and aid in rapid debugging/fixing of those cases.

This code is showing its age, I decided to purposely avoid modernising the code or making code cleanup, although I couldn't resist tightening up some IF conditions and bumping the pelias/model package.

@missinglink

Copy link
Copy Markdown
Member Author

@Joxit pulling in the latest pelias/model caused some additional properties to appear in the functional test fixture which weren't directly related to this work.

These are expected right?

@@ -2261,6 +2564,9 @@
         ],
         "locality_a": [
           null
+        ],
+        "locality_source": [
+          null
         ]
       },
       "center_point": {

@Joxit

Joxit commented Mar 5, 2021

Copy link
Copy Markdown
Member

Yes, this is the expected result. The next step will be this :

diff --git a/lib/streams/overrideLookedUpLocalityAndLocaladmin.js b/lib/streams/overrideLookedUpLocalityAndLocaladmin.js
index 38d9388..f99de68 100644
--- a/lib/streams/overrideLookedUpLocalityAndLocaladmin.js
+++ b/lib/streams/overrideLookedUpLocalityAndLocaladmin.js
@@ -14,13 +14,13 @@ function reassignParent(document, layer) {
   document.clearParent(layer);
 
   // primary name
-  document.addParent(layer, document.getName('default'), document.getId());
+  document.addParent(layer, document.getName('default'), document.getId(), null, 'geonames');
 
   // name aliases
   let aliases = document.getNameAliases('default');
   if( aliases.length ){
     aliases.forEach( alias => {
-      document.addParent(layer, alias, document.getId());
+      document.addParent(layer, alias, document.getId(), null, 'geonames');
     });
   }
 }

@missinglink missinglink merged commit 381825a into master Mar 9, 2021
@missinglink missinglink deleted the popularity branch March 9, 2021 04:05
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.

2 participants