Re: SolrJ looping until I get all the results

2009-11-16 Thread Mck
On Mon, 2009-11-02 at 19:49 -0500, Paul Tomblin wrote: > Here's what I'm thinking > > final static int MAX_ROWS = 100; > int start = 0; > query.setRows(MAX_ROWS); > while (true) > { >QueryResponse resp = solrChunkServer.query(query); >SolrDocumentList docs = resp.getResults(); >if (doc

Re: SolrJ looping until I get all the results

2009-11-02 Thread Avlesh Singh
> > This isn't a search, this is a search and destroy. Basically I need the > file names of all the documents that I've indexed in Solr so that I can > delete them. > Okay. I am sure you are aware of the "fl" parameter which restricts the number of fields returned back with a response. If you need

Re: SolrJ looping until I get all the results

2009-11-02 Thread Paul Tomblin
On Mon, Nov 2, 2009 at 8:47 PM, Avlesh Singh wrote: >> >> I was doing it that way, but what I'm doing with the documents is do >> some manipulation and put the new classes into a different list. >> Because I basically have two times the number of documents in lists, >> I'm running out of memory.  

Re: SolrJ looping until I get all the results

2009-11-02 Thread Avlesh Singh
> > I was doing it that way, but what I'm doing with the documents is do > some manipulation and put the new classes into a different list. > Because I basically have two times the number of documents in lists, > I'm running out of memory. So I figured if I do it 1000 documents at > a time, the So

Re: SolrJ looping until I get all the results

2009-11-02 Thread Paul Tomblin
On Mon, Nov 2, 2009 at 8:40 PM, Avlesh Singh wrote: >> >> final static int MAX_ROWS = 100; >> int start = 0; >> query.setRows(MAX_ROWS); >> while (true) >> { >>   QueryResponse resp = solrChunkServer.query(query); >>   SolrDocumentList docs = resp.getResults(); >>   if (docs.size() == 0) >>     br

Re: SolrJ looping until I get all the results

2009-11-02 Thread Avlesh Singh
> > final static int MAX_ROWS = 100; > int start = 0; > query.setRows(MAX_ROWS); > while (true) > { > QueryResponse resp = solrChunkServer.query(query); > SolrDocumentList docs = resp.getResults(); > if (docs.size() == 0) > break; > > start += MAX_ROWS; > query.setStart(start); >

SolrJ looping until I get all the results

2009-11-02 Thread Paul Tomblin
If I want to do a query and only return X number of rows at a time, but I want to keep querying until I get all the row, how do I do that? Can I just keep advancing query.setStart(...) and then checking if server.query(query) returns any rows? Or is there a better way? Here's what I'm thinking