Searching for indonesia should show the events in Jakarta, for example.
Possible approaches:
MySQL JOIN to geonames_summary or similar table based on the country code in wporg_events. This is probably the simplest if the only thing we need is the country name. Would probably need some kind of GROUP_CONCAT though, to condense the joined rows into a single field. We'll probably want name, asciiname, and alternativenames so that folks can search by endonym etc.
Use the api.w.org/events endpoint. That might be more DRY than writing new code, and possibly give higher quality results, but would be slower. We'd probably also need to adapt the endpoint to fit this context, since we're not searching via IP etc.
Convert the country codes in wporg_events into country names on the fly, based on an array mapping codes to names. the geonames* tables are probably more comprehensive, though.
Add country name column to wporg_events- no, because it'd be more accurate/comprehensive to JOIN to geonames*
add search_terms column to wporg_events - maybe if there's additional data, but if country is the only thing then geonames* is probably better.
See https://wordpress.slack.com/archives/C05JYJJRNKB/p1695174318897539?thread_ts=1694779015.219089&cid=C05JYJJRNKB
Searching for
indonesia
should show the events in Jakarta, for example.Possible approaches:
JOIN
togeonames_summary
or similar table based on the country code inwporg_events
. This is probably the simplest if the only thing we need is the country name. Would probably need some kind ofGROUP_CONCAT
though, to condense the joined rows into a single field. We'll probably wantname
,asciiname
, andalternativenames
so that folks can search by endonym etc.api.w.org/events
endpoint. That might be more DRY than writing new code, and possibly give higher quality results, but would be slower. We'd probably also need to adapt the endpoint to fit this context, since we're not searching via IP etc.wporg_events
into country names on the fly, based on an array mapping codes to names. thegeonames*
tables are probably more comprehensive, though.wporg_events
- no, because it'd be more accurate/comprehensive toJOIN
togeonames*
search_terms
column towporg_events
- maybe if there's additional data, but if country is the only thing thengeonames*
is probably better.Related https://github.com/WordPress/wporg-mu-plugins/issues/476