I am new to Solr and I am trying to integrate it with my PHP application using Solarium. I tried running the ping query but it is failing and giving Solr HTTP error: Not Found (404) response.
My PHP code is as follows:
$config = array(
"endpoint" => array("localhost" => array("host"=>"localhost",
"port"=>8983, "path"=>"/solr", "core"=>"techproducts",)));
try{
$client = new Solarium_Client($config);
}catch (Exception $e){
echo $e->getMessage();
}
if ($client == null) {
echo 'Client null';
} else {
echo 'Client created</br>';
//v($client);
}
// create a ping query
$ping = $client->createPing();
if ($ping == null) {
echo 'ping null';
} else {
echo 'ping created</br>';
//v($ping);
}
// execute the ping query
try{
$result= $client->ping($ping);
echo 'Ping query successful';
echo '<br/><pre>';
//var_dump($result->getData());
}catch(Solarium_Exception $e){
echo $e->getMessage();
}
My Solr server address is :http://localhost:8983/solr/ Core: techproducts
I am getting this output : Client created ping created Solr HTTP error: Not Found (404) Can anyone suggest what can be the possible solutions?
$config = array( "endpoint" => array("localhost" => array("host"=>"localhost", "port"=>8983, "path"=>"/solr/", "core"=>"techproducts",)));
– Tismon Varghese