lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan, Michael F. (LNG-DAY)" <michael.r...@lexisnexis.com>
Subject RE: How to start an optimize in SolrJ without waiting for it to complete?
Date Fri, 01 May 2015 14:31:07 GMT
If I recall correctly, waitSearcher only affects the opening of the new Searcher, and not the
part of the optimize where the segments are being merged together (the long part). I took
a quick look at DirectUpdateHandler2, and I don't see anything to allow the request to return
immediately. I think you'll need to run it on a separate thread.

-Michael

-----Original Message-----
From: Shawn Heisey [mailto:apache@elyograg.org] 
Sent: Friday, May 01, 2015 10:09 AM
To: solr-user@lucene.apache.org
Subject: Re: How to start an optimize in SolrJ without waiting for it to complete?

On 5/1/2015 7:23 AM, Shawn Heisey wrote:
> This is my solrj code:
> 
>   UpdateRequest req = new UpdateRequest("/" + _name + "/update");
>   req.setAction(UpdateRequest.ACTION.OPTIMIZE, false, false);
>   UpdateResponse ur = req.process(_client);

Followup.  I must not have actually been running that code, because when I created a test
program and ran it, I got this in the log:

INFO  - 2015-05-01 08:04:02.246;
org.apache.solr.update.processor.LogUpdateProcessor; [s5live] webapp=/solr path=/update params={optimize=true&waitSearcher=false&maxSegments=1&wt=javabin&version=2}
{optimize=} 0 1221053

Now waitSearcher is set to false, but the call in SolrJ still took over
20 minutes, when what I was after was an immediate return.

Will I need to start a separate thread to allow my program to continue running while an optimize
is happening?

Thanks,
Shawn

Mime
View raw message