php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62332 As of solr 4.0 the waitFlush parameter is removed for commit
Submitted: 2012-06-15 09:18 UTC Modified: 2014-02-28 21:54 UTC
Votes:44
Avg. Score:4.8 ± 0.4
Reproduced:38 of 39 (97.4%)
Same Version:18 (47.4%)
Same OS:10 (26.3%)
From: cliff at jcid dot nl Assigned: omars (profile)
Status: Closed Package: solr (PECL)
PHP Version: 5.3.14 OS: CentOS
Private report: No CVE-ID: None
 [2012-06-15 09:18 UTC] cliff at jcid dot nl
Description:
------------
As of solr 4.0 the waitFlush parameter is removed.

Source
http://wiki.apache.org/solr/UpdateXmlMessages

$client->commit() throws an error
[SolrClientException]
  Unsuccessful update request. Response Code 400. <?xml version="1.0" 
encoding="UTF-8"?>
  <response>

  <lst name="responseHeader">
    <int name="status">400</int>
    <int name="QTime">1</int>
  </lst>
  <lst name="error">
    <str name="msg">Unknown commit parameter 'waitFlush'</str>
    <int name="code">400</int>
  </lst>
  </response>


Patches

simple-fix-62332.patch (last revision 2013-02-05 16:53 UTC by php at elyograg dot org)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-11 07:53 UTC] eborned at gmail dot com
What would be the best approach for this?

- Add an additional option to the SolrClient constructor (solr_api => 4.0)
- Detect the SOLR version by connecting the server (additional overhead?)
- Add an additional option to the SolrClient::commit method (where waitFlush can 
be null -> disable, possible conflicts because null would bind to false?)

For my own build, I have removed the XML attribute from the request. But if I know 
which path to take, a patch should be fairly simple.
 [2012-07-11 16:56 UTC] cliff at jcid dot nl
In my opinion adding a version to not a bad idea but I propose to do this in the 
client options array for the constructor. But to be honest I'm not a c + + 
developer and have no idea how I get around it. So if someone has a working 
version for Solr 4.0, I would like to that the extension.
 [2012-08-07 09:52 UTC] swithun at swithun dot servebeer dot com
The page here says that the waitFlush parameter has been ignored since at least 
Solr1.4:

http://wiki.apache.org/solr/UpdateXmlMessages

It may be easier just to remove it. Solr1.4 came out in 2009.
 [2012-08-08 12:25 UTC] cliff at jcid dot nl
I agree to just remove the waitFlush parameter
 [2012-09-26 19:08 UTC] eric dot caron at gmail dot com
This bug was biting me too. I've commit a fix for it in my GitHub branch (https://github.com/ecaron/php-pecl-solr, also the 1.0.3-alpha download) and would love feedback from others.

As swithun pointed out, the parameter hasn't been used since pre-1.4, so I'm just not including it with the commit call. I left the waitFlush as the 2nd parameter in the commit to maintain backwards compatibility, even though it is effectively ignored in the commit. (waitFlush is still used in optimize, so I still think having an obsolete 2nd parameter would be a best practice w/o incurring a major version increment.
 [2013-02-05 17:06 UTC] php at elyograg dot org
Just attached a patch.  It probably doesn't fix it the right way, and when I ran 'make test' it said that there were failures.  I cooked it up to try and help someone on the #solr irc channel.  Still waiting for feedback about whether it worked or not.
 [2013-02-05 17:56 UTC] php at elyograg dot org
Patch confirmed working in the wild.
 [2014-02-13 18:20 UTC] omars@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: omars
 [2014-02-28 21:54 UTC] omars@php.net
-Status: Assigned +Status: Closed
 [2014-02-28 21:54 UTC] omars@php.net
Fixed in the new release 2.0.0b
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 02 06:03:34 2021 UTC