Presenting images as search results
In one embodiment, accessing a set of characters of a search query currently entered into a text entry box; compiling a first set of search results based on the set of characters currently entered into the text entry box, wherein the compiling is re-executed responsive to changes to the set of characters entered into the text entry box; associating an image with each search result from the first set of search results; and presenting the first set of search results as a first set of images adjacent to the text entry box.
1. A method comprising, by a client device of a user of an online social network:
receiving, by the client device, one or more characters of a search query inputted by the user into a text-entry box, the user being associated with a first node of a social graph of the online social network;
compiling, by the client device, responsive to receiving the search query, a first set of search results associated with one or more second nodes of the social graph, wherein the first set of search results are received from information stored on an internal cache of the client device, wherein each of the search results of the first set of search results corresponds to a second node of the one or more second nodes that is within a threshold degree of separation from the first node of the user, and wherein each search result corresponds to a web page associated with one of the second nodes;
providing, by the client device, for display to the user a list of the first set of search results adjacent to the text-entry box, each search result being interactable with the user to retrieve the corresponding web page associated with the respective second node;
determining, by the client device, whether additional search results beyond the displayed first set of search results are needed to be obtained from a remote server of the online social network based on receiving no user interaction with respect to any search results of the first set of search results and receiving an indication that a threshold number of characters has been inputted by the user;
if there is a positive determination that additional results beyond the displayed first set of search results are needed to be obtained from the remote server of the online social network, then:
sending, from the client device to the remote server of the online social network, an additional request to execute the search query on the remote server;
receiving, at the client device from the remote server of the online social network, a second set of search results associated with one or more third nodes of the social graph, the second set of search results received from the remote server being different from the first set of search results received from the internal cache of the client device; and
providing, by the client device, for display to the user a list of the second set of search results adjacent to the text-entry box; and
if there is a determination that no additional results beyond the displayed first set of search results are needed, then not sending the additional request to the remote server of the online social network to execute the search query.
2. The method of claim 1 , further comprising:
receiving one or more additional characters of the search query inputted by the user into the text-entry box, wherein at least one of the first set of search results and the second set of search results is displayed to the user prior to receiving the one or more additional characters.
3. The method of claim 1 , wherein providing for display to the user the list of the first set of search results comprises:
assigning a portion of a screen of the client device to each of one or more search results in the first set of search results and the second set of search results; and
displaying an image associated with each of the one or more search results in the first set of search results and the second set of search results in the portion of the screen assigned to the respective search result, wherein the image substantially consumes the portion of the screen.
4. The method of claim 3 , wherein each of the one or more images associated with the first set of search results corresponds to the respective second node, the one or more images being selected based on selecting an image from one or more images associated with the respective second node, and wherein each of the one or more images associated with the second set of search results corresponds to the respective third node, the one or more images of the second set of search results being selected based on selecting an image from one or more images associated with the respective third node.
5. The method of claim 1 , wherein the threshold degree of separation comprises a single degree of separation, two degrees of separation, or any degree of separation.
6. The method of claim 1 , further comprising:
for each search result in the first set of search results, computing a coefficient of the search result, wherein the coefficient is based on an affinity measure of the user for the search result, the affinity measure being based in part on a degree of separation between the node associated with the search result and a user node of the social graph, and the user node corresponding to the user requesting the search.
7. The method of claim 1 , wherein the one or more second nodes are different from the one or more third nodes.
8. The method of claim 1 , wherein each of the search results in the first set of search results matches the characters of the search query.
9. The method of claim 1 , wherein each of the search results in the second set of search results matches the characters of the search query.
10. The method of claim 1 , wherein the search query comprises N characters, and wherein the first set of search results is generated responsive to the first user inputting the Nth character.
11. The method of claim 1 , wherein the search query comprises N characters, and wherein the second set of search results is generated responsive to the first user inputting an Nth+1 character.
12. The method of claim 1 , each of the search results in the first set of search results comprises one or more images associated with the one or more second nodes, and each of the search results in the second set of search results comprises one or more images associated with the one or more third nodes.
13. The method of claim 1 , wherein the not sending the request to the online social network is based on a determination that additional results are not needed.
14. The method of claim 1 , wherein the receiving of no user interaction with respect to any search results of the first set of search results occurs within a predetermined period of time.
15. A system comprising: a memory comprising instructions executable by one or more processors; and the one or more processors coupled to the memory and operable to execute the instructions, the one or more processors being operable when executing the instructions to:
receive, by a client device of a user of an online social network, one or more characters of a search query inputted by the user into a text-entry box, the user being associated with a first node of a social graph of the online social network;
compile, by the client device, responsive to receiving the search query, first set of search results associated with one or more second nodes of the social graph, wherein the first set of search results are received from information stored on an internal cache of the client device, wherein each of the search results of the first set of search results corresponds to a second node of the one or more second nodes that is within a threshold degree of separation from the first node of the user, and wherein each search result corresponds to a web page associated with one of the second nodes;
provide, by the client device, for display to the user a list of the first set of search results adjacent to the text-entry box, each search result being interactable with the user to retrieve the corresponding web page associated with the respective second node;
determine, by the client device, whether additional search results beyond the displayed first set of search results are needed to be obtained from a remote server of the online social network based on receiving no user interaction with respect to any search results of the first set of search results and receiving an indication that a threshold number of characters has been inputted by the user;
if there is a positive determination that additional results beyond the displayed first set of search results are needed to be obtained from the remote server of the online social network, then:
send, from the client device to the remote server of the online social network, an additional request to execute the search query on the remote server;
receive, at the client device from the remote server of the online social network, a second set of search results associated with one or more third nodes of the social graph, the second set of search results received from the remote server being different from the first set of search results received from the internal cache of the client device; and
provide, by the client device, for display to the user a list of the second set of search results adjacent to the text-entry box; and
if there is a determination that no additional results beyond the displayed first set of search results are needed, then not send the additional request to the remote server of the online social network to execute the search query.
16. The system of claim 15 , wherein the one or more processors are further operable when executing the instructions to:
receive one or more additional characters of the search query inputted by the user into the text-entry box, wherein at least one of the first set of search results and the second set of search results is displayed to the user prior to receiving the one or more additional characters.
17. The system of claim 15 , wherein providing for display to the user list of the first set of search results comprises:
assigning a portion of a screen of a client device to each of one or more search results in the first set of search results and the second set of search results; and
displaying an image associated with each of the one or more search results in the first set of search results and the second set of search results in the portion of the screen assigned to the respective search result, wherein the image substantially consumes the portion of the screen.
18. The system of claim 17 , wherein each of the one or more images associated with the first set of search results corresponds to the respective second node, the one or more images being selected based on selecting an image from one or more images associated with the respective second node, and
wherein each of the one or more images associated with the second set of search results corresponds to the respective third node, the one or more images of the second set of search results being selected based on selecting an image from one or more images associated with the respective third node.
19. One or more computer-readable non-transitory storage media embodying software operable when executed by one or more computer systems to:
receive, by a client device of a user of an online social network, one or more characters of a search query inputted by the user into a text-entry box, the user being associated with a first node of a social graph of the online social network;
compile, by the client device, responsive to receiving the search query, a first set of search results associated with one or more second nodes of the social graph, wherein the first set of search results are received from information stored on an internal cache of the client device, wherein each of the search results of the first set of search results corresponds to a second node of the one or more second nodes that is within a threshold degree of separation from the first node of the user, and wherein each search result corresponds to a web page associated with one of the second nodes;
provide, by the client device, for display to the user a list of the first set of search results adjacent to the text-entry box, each search result being interactable with the user to retrieve the corresponding web page associated with the respective second node;
determine, by the client device, whether additional search results beyond the displayed first set of search results are needed to be obtained from a remote server of the online social network based on receiving no user interaction with respect to any search results of the first set of search results and receiving an indication that a threshold number of characters has been inputted by the user;
if there is a positive determination that additional results beyond the displayed first set of search results are needed to be obtained from a remote server of the online social network, then:
send, from the client device to the remote server of the online social network, an additional request to execute the search query on the remote server;
receive, at the client device from the remote server of the online social network, a second set of search results associated with one or more third nodes of the social graph, the second set of search results received from the remote server being different from the first set of search results received from the internal cache of the client device; and
provide, by the client device, for display to the user a list of the second set of search results adjacent to the text-entry box; and
if there is a determination that no additional results beyond the displayed first set of search results are needed, then not send the additional request to the remote server of the online social network to execute the search query.