lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <>
Subject How to start an optimize in SolrJ without waiting for it to complete?
Date Fri, 01 May 2015 13:23:48 GMT
This is my solrj code:

  UpdateRequest req = new UpdateRequest("/" + _name + "/update");
  req.setAction(UpdateRequest.ACTION.OPTIMIZE, false, false);
  UpdateResponse ur = req.process(_client);

The _name variable contains the name of the core, and _client is a 5.0
SolrClient, specifically HttpSolrClient.  I'm trying to kick off an
optimize against a specific core without waiting for it to finish.  All
my research and testing says that this is safe to do as long as the Solr
server is at least 4.0.  The servers that this code runs against are
4.7.2 and 4.9.1.

This is the resulting log entry:

INFO  - 2015-05-01 03:30:34.689;
org.apache.solr.update.processor.LogUpdateProcessor; [s1build]
webapp=/solr path=/update
{optimize=} 0 2

Notice the waitSearcher=true in that log.  I have set both waitFlush and
waitSearcher to false with setAction in my code.  How do I successfully
start an optimize and return immediately, without waiting for it to


View raw message