Techniques for querying a product in a database of a publication system using a tail query are presented. An application interface module receives, from a device of a user, a tail query for a product in the publication system. The tail query has a common term and an uncommon term. A data storage interface module can access, from a search metrics database, a plurality of product categories associated with the common term, and access user behavior data, with the user behavior data including product views corresponding to past search queries in the publication system. A category predictor can determine a first product category from the plurality of product categories for the tail query based on the user behavior data and information derived from the search metrics database. A listing generator can generate an ordered list of product listings associated with the first product category based on the user behavior data.