Solr error when update a document

65 megtekintés
Ugrás az első olvasatlan üzenetre

Uruca A

olvasatlan,
2015. jún. 1. 7:45:522015. 06. 01.
– php-...@googlegroups.com
I have use this code to begin with my new solr search. 
include "BootStrap.php";

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,

);

$client = new SolrClient($options);

$doc = new SolrInputDocument();
/*$doc->addField('idDocument', 1);
$doc->addField('titleFr', 'Le petit poucet');
*/

$doc->addField(utf8_encode('idDocument'), utf8_encode(1));
$doc->addField(utf8_encode('titleFr'), utf8_encode('Le petit poucet'));

var_dump($doc->getFieldNames());
$updateResponse = $client->addDocument($doc, true, 10000);
//$client->commit();
var_dump($updateResponse->getResponse());
My BootStrap.php is :
 
 /* Nom de domaine du serveur Solr */
define('SOLR_SERVER_HOSTNAME', 'localhost:81/solr/#/testDocument/');

/* Si l'on doit exécuter en mode sécurisé ou non */
define('SOLR_SECURE', true);

/* Port HTTP de connexion */
define('SOLR_SERVER_PORT', ((SOLR_SECURE) ? 8443 : 8983));

/* Nom d'utilisateur pour l'authentification HTTP Basic */
define('SOLR_SERVER_USERNAME', 'admin');

/* Mot de passe pour l'authentification HTTP Basic */
define('SOLR_SERVER_PASSWORD', '');

/* Délai maximal de connexion HTTP */
/* C'estla durée maximale en secondes autorisée pour l'opération de transfert de données http. La valeur par défaut est 30 secondes */
define('SOLR_SERVER_TIMEOUT', 10);

/* Nom du fichier de la clé privée formattée PEM + du certificat privé (concaténés dans cet ordre) */
define('SOLR_SSL_CERT', 'certs/combo.pem');

/* Nom du fichier du certificat privé formatté PEM seulement */
define('SOLR_SSL_CERT_ONLY', 'certs/solr.crt');

/* Nom du fichier de la clé privée formattée PEM */
define('SOLR_SSL_KEY', 'certs/solr.key');

/* Mot de passe pour le fichier de la clé privée formattée PEM */
define('SOLR_SSL_KEYPASSWORD', 'StrongAndSecurePassword');

/* Nom du fichier contenant un ou plusieurs certificats CA pour l'authentification */
define('SOLR_SSL_CAINFO', 'certs/cacert.crt');

/* Nom du dossier contenant les certificats CA pour l'authentification */
define('SOLR_SSL_CAPATH', 'certs/');
And when i use it. I have these errors:

Warning: SolrClient::addDocument(): Entity: line 4: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xE9 0x74 0x68 0x6F in C:\wamp\www\testAntoine2\send.php on line 84
 
Warning: SolrClient::addDocument(): in C:\wamp\www\testAntoine2\send.php on line 84

 
Warning: SolrClient::addDocument(): ^ in C:\wamp\www\testAntoine2\send.php on line 84

 
Warning: SolrClient::addDocument(): Xpath Error: no elements found in C:\wamp\www\testAntoine2\send.php on line 84

Fatal error: Uncaught exception 'SolrClientException' with message ' in C:\wamp\www\testAntoine2\send.php on line 84

 
 SolrClientException: in C:\wamp\www\testAntoine2\send.php on line 84
 
I try a lot of things but now i have no idea where it's came from... 

Do you have any ideas please. :)
Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet