WordPress / wordcamp.org

WordCamps are casual, locally-organized conferences covering everything related to WordPress.
https://wordcamp.org
127 stars 69 forks source link

Search landing page events by country #1046

Open iandunn opened 11 months ago

iandunn commented 11 months ago

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:

  1. 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.
  2. 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.
  3. 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.
  4. Add country name column to wporg_events- no, because it'd be more accurate/comprehensive to JOIN to geonames*
  5. 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.

Related https://github.com/WordPress/wporg-mu-plugins/issues/476

iandunn commented 9 months ago

We have a filter for country now, so this may be less important