just set the rows to a very large number, larger than the number of documents 
available 

useful to set the fl parameter with the fields required to avoid memory 
problems, if each document contains a lot of information 


----- Original Message ----- 
From: "stefan maric" <stefan.ma...@bt.com> 
To: solr-user@lucene.apache.org 
Sent: Wednesday, 10 February, 2010 2:14:05 PM 
Subject: RE: How to not limit maximum number of documents? 

Egon 

If you first run your query with q=<query>&rows=0 

Then your you get back an indication of the total number of docs 
<result name="response" numFound="53" start="0"/> 

Now your app can query again to get 1st n rows & manage forward|backward 
traversal of results by subsequent queries 



Regards 
Stefan Maric 

-----Original Message----- 
From: ego...@gmx.de [mailto:ego...@gmx.de] 
Sent: 10 February 2010 14:08 
To: solr-user@lucene.apache.org 
Subject: Re: How to not limit maximum number of documents? 

Hi Stefan, 

you are right. I noticed this page-based result handling too. For web pages it 
is handy to maintain a number-of-results-per-page parameter together with an 
offset to browse result pages. Both can be done be solr's 'start' and 'rows' 
parameters. 
But as I don't use Solr in a web context it's important for me to get all 
results in one go. 

While waiting for answers I was working on a work-around and came across the 
LukeRequestHandler (http://wiki.apache.org/solr/LukeRequestHandler). It allows 
to query the index and obtain meta information about it. I found a parameter in 
the response called 'numDocs' which seams to contain the current number of 
index rows. 

So I was now thinking about first asking for the number of index rows via the 
LukeRequestHandler and then setting the 'rows' parameter to this value. 
Apparently, this is quite expensive as one front-end query always leads to two 
back-end queries. So I'm still searching for a better way to do this! 

Cheers, 
Egon 



-------- Original-Nachricht -------- 
> Datum: Wed, 10 Feb 2010 13:19:05 +0000 
> Von: stefan.ma...@bt.com 
> An: solr-user@lucene.apache.org 
> Betreff: RE: How to not limit maximum number of documents? 

> I was just thinking along similar lines 
> 
> As far as I can tell you can use the parameters start & rows in 
> combination to control the retrieval of query results 
> 
> So 
> http://<host>:<port>/solr/select/?q=<query> 
> Will retrieve up to results 1..10 
> 
> http://<host>:<port>/solr/select/?q=<query>&start=11&rows=10 
> Will retrieve up results 11..20 
> 
> So it is up to your application to control result traversal/pagination 
> 
> 
> Question - does this mean that 
> http://<host>:<port>/solr/select/?q=<query>&start=11&rows=10 
> Runs the query a 2nd time 
> 
> And so on 
> 
> 
> Regards 
> Stefan Maric 

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! 
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 

Reply via email to