I'm trying to plan out a "matching engine" - any time a user joins the service, or updates their profile they are checked against everybody who might potentially match with them (same interests, languages etc.) Is there some way to optimise this matching process beyond just comparing the user document to every other document in the database? Could I use some sort of cacheing, or a search engine approach?
People have multiple fields, like age, languages, hobbies. I want to for example match people whose ages are closer, so it would be somewhat soft (weighted??) i think. But for other things like location, i would like a hard filter (both people have to be in the same city).
How would you approach a matching engine?