I’m creating a facebook application which matches people people based on a set of criteria, and I figure it’s pretty easy to make a query to search the database for people matching the criteria EXACTLY, but was wondering how websites normally generate results which don’t exactly match the criteria.
I was thinking of something like a tally system where I look at the first parameter and find all the people who match that and increment a counter for their id, then look at the second and increment a counter for all the ones which match that etc. Then just display the results for the cases with the highest counters. The problem with this is that some criteria may be more important than others and I guess this could be solved with giving them a higher weighting i.e. increment counter by higher value.
So my questions are:
- How do websites normally do this and are there any standard php recipes for this?
- Is the algorithm I suggested feasible?
- What is this general area called? (I don't know what I should be searching google for...)