Hi, The fact that you need the cheapest price (personal nitpick: prices are not cheap - they can be low, which makes items cheap) I think you'd want to sort by the price field. As for showing N items for each city, you'd either want to grab a lot of docs in 1 query and then run another query with the cities ORed to get N items for each city or maybe field collapsing (issue in JIRA) might work for you.
Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch ----- Original Message ---- > From: Kenny Lee <[EMAIL PROTECTED]> > To: solr-user@lucene.apache.org > Sent: Thursday, July 31, 2008 10:33:23 PM > Subject: Individual query limits for each search field value > > Hi Guys, > > Let's say i need a query to get the cheapest beef prices in US cities, > > So, > > select?q=cities=NYC,LAS,MIA,SFO&limit=50 > > Problem is there may be more than 50 prices in NYC alone, thus for the rest > of the cities like LAS,MIA,SFO, the results might not be returned. > > Is there a way to limit the results of each city to let's say 10, via > solr/lucene query, or would i have to make separate calls for each city, > with the limit 10 like > > select?q=cities=NYC&limit=10 > select?q=cities=LAS&limit=10 > select?q=cities=MIA&limit=10 > select?q=cities=SFO&limit=10 > > Best Wishes, > Kenny