So you want to take the top 1000 sorted by score, then sort those by another 
field. It's a strange case, and I can't think of a clean way to accomplish it. 
You could do it in two queries, where the first is by score and you only 
request your IDs to keep it snappy, then do a second query against the IDs and 
sort by your other field. 1000 seems like a lot for that approach, but who 
knows until you try it on your data.

-Kallin Nagelberg 


-----Original Message-----
From: Paul [mailto:p...@nines.org] 
Sent: Wednesday, July 14, 2010 4:16 PM
To: solr-user
Subject: limiting the total number of documents matched

I'd like to limit the total number of documents that are returned for
a search, particularly when the sort order is not based on relevancy.

In other words, if the user searches for a very common term, they
might get tens of thousands of hits, and if they sort by "title", then
very high relevancy documents will be interspersed with very low
relevancy documents. I'd like to set a limit to the 1000 most relevant
documents, then sort those by title.

Is there a way to do this?

I guess I could always retrieve the top 1000 documents and sort them
in the client, but that seems particularly inefficient. I can't find
any other way to do this, though.

Thanks,
Paul

Reply via email to