Tell me more ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

When you start searching for someone in Facebook's search bar, it will automatically start bringing back finds. What is the algorithm here? Is order arbitrary, and if not what determines it?

Edit: My reason for asking is that a friend of mine tried searching for "Rachel", and the first result was a Rachel that was friends with me. Their only common friend is me. Below her was another Rachel with whom he shared more mutual friends. This just seemed peculiar so I was wondering if anyone had some insight into why this might be the case.

share|improve this question

12 Answers

I don't know for certain (I don't work for Facebook!), but from my experience it seems to bring back results in (approximately) the following order:

  1. From your friends
  2. From your friends friends
  3. People with common interests (liked pages, shared groups etc.)

After this it starts to become more guesswork, but I suspect that home town, shared work places etc all come into play as well.

With more than 500 million users there's a lot of data and existing connections they can use to base their heuristics on

share|improve this answer

It starts with the letter of input makes a quick query from multiple database's and or tables. Say you start typing v. It looks first for any of your friends names that start with a v. If it finds a friend it then displays it.

I've noticed that if you have a friends page that you visit more often. If you then start typing the first letter it shows that as a first result. So it seems they save your frequently searched allowing them to give you better results.

share|improve this answer

It's possible that he is more active with you on facebook than with the other friends, which would place the first Rachel higher in the algorithm than the Rachel who is friends with people he doesn't interact with as much.

Again, this is just conjecture as I don't work for Facebook.

share|improve this answer

There is a pretty in-depth post about how Facebook Search works posted on Facebook Engineering's page:

http://www.facebook.com/note.php?note_id=365915113919

share|improve this answer
3  
Could you summarise the relevant section here. It guards against link rot (I know this is Facebook, but you never know). – ChrisF Jan 25 '11 at 8:00

Here's what I've noticed. Whenever I search for a friend on facebook, I start to type the person's name, and after the first few letters, I get a list of people who's first or last name starts with the letters I've typed. NORMALLY, the list of friends starts with people I'm already friends with, and leads into people who I might possibly know through mutual friends. BUT...

I've recently started dating a guy. Now, when I type in the letter "G" to search my friend Georgia, the first person on my list is my boyfriend's best friend who's last name begins with "G". Then I tried "K" for Kelly. Instead of seeing my friend Kelly who would normally appear, I get a list of people with the last name Keats - my boyfriend's sisters, mother, aunt, and cousins. I haven't visited any of these profiles before, so I'm guessing that they're all checking out mine to see what the new girl is all about. That just goes to show that the search results are based, at least in part, on profile visits.

share|improve this answer

I feel it has to do with who views your page, for how long, who you view, for how long, and how frequently you search them. Your friends probably has a somewhat large value to show up first and/or their friends and the value can probably be lowered than a non-friend due to the time factor spent on a non-friend's page. Maybe even clicks is played into the search. There is a complicated formula. Facebook is crazy about this stuff. In the movie, when Mark (facebook CEO) did the site about which girl at school was hot or not, he ask a friend to come up with a formula to determine a winner. With how brilliant facebook has become, I don't doubt for a second that they take into consideration all these factors and 20,000 others when designing this formula.

I liked this guy and I couldn't find his page. Of course he was searching me as well and I'm assuming the reason why I was unable to search him was because he made his page only searchable to friends. (he has a girlfriend that's why and didn't want me to know) When he did allow me to search him, he was the first one after I typed his name. I didn't see this before.

share|improve this answer

I can definitely say that there are people who have come up on that list who are not my Facebook friends, and who I have never looked up, and I recognize them from my past. Also, I have an old flame who I looked up and he was at the top of my list there, then he moved to the third one down (all three starting with the letter A), and I didn't look him up again, and then he moved to the top.

Hard to say but I would guess the one's at the top are looking at your profile.

share|improve this answer

i think when i put a letter like A/t/f/r.....etc, the friends which appear in the list consists some friends/ friend of friend whom i searched for and some friends/ friends of friends/ unknown people who searched for me. And the top one is the top most stalker of me or i am the top most stalker for them....within that letter.

share|improve this answer

When I go on to my boyfriend's profile and type the letter C in his search bar then the first result is his ex girlfriend, whom he is not friends with on facebook, so I think it can show up the people who look at your page as he swears he's only been on her page once in the last year and a half and yet she shows up ahead of his friends pages. If this is not the case, he'll be single soon!

share|improve this answer
Does this give an in-depth view of how Facebook guesses the search? – Jacob Jan Tuinstra Jan 6 at 20:00

I believe that it could be someone that recently viewed your profile. No one else has brought this up.

share|improve this answer

Mutual friends show up first. As you type close to some name and the results are not your friends and you had never visited their profiles, then it is someone who visited you recently.

Also the pages and people you visit the most pop up first.

share|improve this answer

I am actually almost certain it has to do with people who view your page because I was thinking about this and conducted a little experiment (it's kinda confusing but bear with me).

I started off by typing every letter of the alphabet and seeing who came up on the search. So for example, I typed "A" and saw who came up. I noticed that the list of people were not necessarily in alphabetical order, but the people at the top were certainly my closest friends whose pages I visit all the time.

Then I thought maybe Facebook sets the search bar up conveniently for you to find the people you visit the most. But then I saw something strange, the girl that I just added was actually the second person in the "L" list, the first being my best friend, so that seemed odd to me.

So then I started thinking that it might actually have to do with the people who visit your page. To test the theory, I went to my "C" list, where the top two people were actually pretty much equal in terms of how many times I've visited their page and I assume they've visited mine. I went to the second person in the "C" list and clicked on their page a lot, refreshed it a few good times. Then I went back and searched "C" and sure enough, it was now the second friend whose page I had been refreshing who showed up first. I knew that this second friend was camping and had no Facebook/no way of looking at my page.

Now here's the real kicker: I told my other friend in the "C" list, the one who used to be first when I searched "C" to go on my page a couple of times. She did. I then took a couple of minutes and searched "C" again, and guess who came up first?

That's right, the girl who had just searched my page, despite the fact that I had been looking up the other girl's page recently.

Does this really prove that the Facebook search bar operates on people who have viewed your profile? Maybe, but it could also prove that I have WAY too much time on my hands.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.