1. A method comprising: identifying a first group of mappings generated for dominant queries associated with a query log containing a plurality of user queries; identifying a second group of mappings that includes mappings between a first set of queries and categories shown for the first set of queries, and mappings between a second set of queries and clicked products for the second set of queries; receiving a query; applying, using one or more processors, the second group of mappings for the received query if the category mappings for the received query are in the second group of mappings; and applying, using the one or more processors, the first group of mappings for the received query if the category mappings for the received query are in the first group of mappings but not in the second group of mappings.