|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59317 SolrInputDocument::setBoost not working with German locale
Submitted: 2010-07-21 07:34 UTC Modified: 2014-02-13 20:28 UTC
From: luetjen at huberverlag dot de Assigned: omars (profile)
Status: Wont fix Package: solr (PECL)
PHP Version: 5.2.5 OS: Debian Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: luetjen at huberverlag dot de
New email:
PHP Version: OS:


 [2010-07-21 07:34 UTC] luetjen at huberverlag dot de
It seems that the float to string conversion is not working correctly for SolrInputDocument::setBoost() when the PHP locale contains the rule, that the delimiter is something else than a dot. The value will be written with the formatting defined by the locale in the XML file, which leads to a 500 error on Solr server side.

Reproduce code:
// With German PHP locale
setlocale(LC_ALL, 'de_DE');
echo (string) 1.5; // will output 1,5

// and
$doc = new SolrInputDocument();

results in the following XML:
  <doc boost="2,5">
    <field name="id">177683</field>

and Solr responds:

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
HTTP Status 500 - For input string: &quot;2,5&quot;

Expected result:
<doc boost="2.5">

Actual result:
<doc boost="2,5">


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-21 23:03 UTC]
Thanks for reporting this.

This will be taken care of in the next release.
 [2014-02-13 18:31 UTC]
-Assigned To: iekpo +Assigned To: omars
 [2014-02-13 20:28 UTC]
-Status: Assigned +Status: Wont fix
 [2014-02-13 20:28 UTC]
PHP 5.2.5 became obsolete, and 5.3 is reaching EOL.

The issue does not persist for versions 5.3+
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 09:01:29 2024 UTC