|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-02-14 17:56 UTC] omars@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: omars
[2016-02-20 02:50 UTC] omars@php.net
[2016-02-20 02:50 UTC] omars@php.net
-Status: Assigned
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 13:00:01 2025 UTC |
Description: ------------ Solr expects boosts to be specified as a float with a dot as decimal character. In solr_functions_document.c, document_boost and field_boost is converted to a string with sprintf. sprintf uses locale info for converting float into a string. In an environment where decimal delimiter is a comma, solr will not accept the documents. One solution might be to temporarily switch locale to C before the sprintf calls. Another one would not to use sprintf and use another function that is not locale aware. Test script: --------------- <?php /* use a system locale where decimal delimiter is not a dot. */ $clientOptions = array('hostname' => 'localhost', 'port' => '8080', 'path' => '/solr/core'); $solrClient = new \SolrClient($clientOptions); $document = new \SolrInputDocument(); document->setBoost(1.0); $solrClient->addDocuments(array($document)); ?> Expected result: ---------------- Solr would accept inserted documents not depending of the locale settings. Actual result: -------------- Solr fails importing the document with java.lang.NumberFormatException: For input string: "1,0"