A method comprising, by one or more computing devices: accessing a social graph comprising a plurality of nodes (302, 304) and a plurality of edges connecting the nodes, each of the edges between two of the nodes representing a single degree of separation between them, the nodes comprising: a first-user node corresponding to a first user associated with an online social network; and a plurality of second nodes that each correspond to a concept or a second user associated with the online social network; receiving from a client device of the first user a substantially unstructured text query comprising one or more n-grams; identifying one or more of the second nodes, each of the identified second nodes corresponding to one or more of the n-grams; characterized by identifying one or more of the edges, each of the identified edges being connected to at least one of the identified second nodes, each of the identified edges corresponding to one or more of the n-grams; generating one or more structured queries that each comprise references to one or more of the identified second nodes and one or more of the identified edges; sending one or more of the structured queries to the client device of the first user; receiving from the client device of the first user a selection of one of the structured queries; generating search results corresponding to the selection of one of the structured queries, the search results comprising references to one or more of the second nodes that are connected to at least one of the identified second nodes by at least one of the identified edges; and sending the search results to the client device of the first user. accessing a social graph comprising a plurality of nodes (302, 304) and a plurality of edges connecting the nodes, each of the edges between two of the nodes representing a single degree of separation between them, the nodes comprising: a first-user node corresponding to a first user associated with an online social network; and a plurality of second nodes that each correspond to a concept or a second user associated with the online social network; receiving from a client device of the first user a substantially unstructured text query comprising one or more n-grams; identifying one or more of the second nodes, each of the identified second nodes corresponding to one or more of the n-grams; identifying one or more of the edges, each of the identified edges being connected to at least one of the identified second nodes, each of the identified edges corresponding to one or more of the n-grams; generating one or more structured queries that each comprise references to one or more of the identified second nodes and one or more of the identified edges; sending one or more of the structured queries to the client device of the first user; receiving from the client device of the first user a selection of one of the structured queries; generating search results corresponding to the selection of one of the structured queries, the search results comprising references to one or more of the second nodes that are connected to at least one of the identified second nodes by at least one of the identified edges; and sending the search results to the client device of the first user.