TL;DR Index every gallery photo into one collection per event, keyed by your own photo id. When a guest uploads a selfie, search that collection and show the returned photo ids, strongest match first. For a 3,000-photo wedding with 120 guest searches, indexing costs about $1.86, searches about $0.11 and a month of storage about $0.05. Most of the work is elsewhere: rejecting bad selfies at upload, choosing a threshold, a "not me" button, and deleting the collection when the gallery closes.
A photographer delivers 3,000 photos from a wedding. Within a day, 120 guests have asked the same question: which ones am I in? Scrolling a public gallery link is how most of them give up, and it also shows every guest's photos to everyone with the link. Selfie search fixes both. The guest takes one selfie and sees only the photos they appear in.
We run this feature on real event galleries, so this guide is the version with the edge cases in it.…