Facebook uses a server-side script, loaded when you use the site, calledfirst_degree.php. This acts as a ranking algorithm, likely to be based on those who you interact with, the profiles you visit, who you chat and communicate with and those who you have recently become acquainted with.
The higher the negative number, the more likely the person attached to it will display in Facebook's autocomplete search — at the top of the window.
As described by the discoverers, there are probably two crucial files — one that opens your "first degree" friends, and another which loads your "first degree" pages and events. By indexing these results over time, it allows Facebook to deliver seemingly the best user for the search query.
But perhaps more worryingly, this isclient-side, making this data available to the computer you are using — and any malware lurking on it, too.
After trying this out for myself, not only is it relatively accurate, with a few odd exceptions, I was overcome with a sense of violation.
Why is Facebook recording which profiles I visit the most? What other data collection means is Facebook using to 'enhance the experience'?
What is not clear is how Facebook directly uses this information outside of the search function. What is clear, however, is that Facebook is a goldmine of information. Even clicking on someone's profile can alter the algorithm-like functions of the site, to seemingly rank one person higher than the other.